Skip to content

Commit

Permalink
fix: update timezone in test
Browse files Browse the repository at this point in the history
The default time value assertion in the test_default_local_var_recv() function
uses the "GMT" time zone, but local.go when creating a default TIME value uses
a "UTC" time standard. This causes tests to fail when run in the UK (BST):

```
--- FAIL: TestTester (0.00s)
    --- FAIL: TestTester/empty_and_notset_value_test (0.00s)
        runner_test.go:386: Test case "default value check" raises error: Assertion Error: Assertion error: expect=Thu, 01 Jan 1970 01:00:00 GMT, actual=Thu, 01 Jan 1970 00:00:00 GMT
FAIL
```

To resolve this, update the test to use "UTC".
  • Loading branch information
acme committed Jul 25, 2024
1 parent b62c25f commit 7768297
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/testing/default_values.test.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ sub test_default_local_var_recv {
assert.false(var.bool);
assert.equal(var.integer, 0);
assert.equal(var.float, 0.000);
assert.equal(var.time, std.time("Thu, 01 Jan 1970 00:00:00 GMT", now));
assert.equal(var.time, std.time("Thu, 01 Jan 1970 00:00:00 UTC", now));
assert.equal(var.rtime, 0s);

if (!var.string) {
Expand Down

0 comments on commit 7768297

Please sign in to comment.