aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_datetime_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-08-14 16:51:10 +0200
committerKim Alvefur <zash@zash.se>2022-08-14 16:51:10 +0200
commitd79609ddc922ef12032c738fdb8e602818f244e0 (patch)
treec93f0222da41288a4f9c7dd03f354526bac56b86 /spec/util_datetime_spec.lua
parent48ee5e3cbd3acaaeae817af0646a60dbdfa79639 (diff)
downloadprosody-d79609ddc922ef12032c738fdb8e602818f244e0.tar.gz
prosody-d79609ddc922ef12032c738fdb8e602818f244e0.zip
util.datetime: Fix argument order in tests
The expected value goes first.
Diffstat (limited to 'spec/util_datetime_spec.lua')
-rw-r--r--spec/util_datetime_spec.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/util_datetime_spec.lua b/spec/util_datetime_spec.lua
index 497ab7d3..aff55c7b 100644
--- a/spec/util_datetime_spec.lua
+++ b/spec/util_datetime_spec.lua
@@ -16,7 +16,7 @@ describe("util.datetime", function ()
assert.truthy(string.find(date(), "^%d%d%d%d%-%d%d%-%d%d$"));
end);
it("should work", function ()
- assert.equals(date(1136239445), "2006-01-02");
+ assert.equals("2006-01-02", date(1136239445));
end);
end);
describe("#time", function ()
@@ -32,7 +32,7 @@ describe("util.datetime", function ()
assert.truthy(string.find(time(), "^%d%d:%d%d:%d%d"));
end);
it("should work", function ()
- assert.equals(time(1136239445), "22:04:05");
+ assert.equals("22:04:05", time(1136239445));
end);
end);
describe("#datetime", function ()
@@ -48,7 +48,7 @@ describe("util.datetime", function ()
assert.truthy(string.find(datetime(), "^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d:%d%d"));
end);
it("should work", function ()
- assert.equals(datetime(1136239445), "2006-01-02T22:04:05Z");
+ assert.equals("2006-01-02T22:04:05Z", datetime(1136239445));
end);
end);
describe("#legacy", function ()
@@ -64,9 +64,9 @@ describe("util.datetime", function ()
end);
it("should work", function ()
-- Timestamp used by Go
- assert.equals(parse("2017-11-19T17:58:13Z"), 1511114293);
- assert.equals(parse("2017-11-19T18:58:50+0100"), 1511114330);
- assert.equals(parse("2006-01-02T15:04:05-0700"), 1136239445);
+ assert.equals(1511114293, parse("2017-11-19T17:58:13Z"));
+ assert.equals(1511114330, parse("2017-11-19T18:58:50+0100"));
+ assert.equals(1136239445, parse("2006-01-02T15:04:05-0700"));
end);
it("should handle timezones", function ()
-- https://xmpp.org/extensions/xep-0082.html#example-2 and 3