Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update timezone in test #340

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: update timezone in test
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
commit 7768297f5eaa5f6527e081e4548aedeae8884736
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