MCPcopy
hub / github.com/google/mtail / TestStrptimeWithoutTimezone

Function TestStrptimeWithoutTimezone

internal/runtime/vm/vm_test.go:797–808  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

795}
796
797func TestStrptimeWithoutTimezone(t *testing.T) {
798 obj := &code.Object{Program: []code.Instr{{code.Strptime, 0, 0}}}
799 vm := New("strptimezone", obj, true, nil, false, false)
800 vm.t = new(thread)
801 vm.t.stack = make([]interface{}, 0)
802 vm.t.Push("2012/01/18 06:25:00")
803 vm.t.Push("2006/01/02 15:04:05")
804 vm.execute(vm.t, obj.Program[0])
805 if vm.t.time != time.Date(2012, 1, 18, 6, 25, 0, 0, time.UTC) {
806 t.Errorf("Time didn't parse with location: %s received", vm.t.time)
807 }
808}
809
810// code.Instructions with datum retrieve.
811func TestDatumFetchInstrs(t *testing.T) {

Callers

nothing calls this directly

Calls 3

PushMethod · 0.80
executeMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected