| 795 | } |
| 796 | |
| 797 | func 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. |
| 811 | func TestDatumFetchInstrs(t *testing.T) { |