]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add test for (date - date --> uint32)
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2024 15:33:05 +0000 (11:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2024 15:33:05 +0000 (11:33 -0400)
which should come out as seconds

src/tests/unit/calc.txt

index 4e1514da7c952f2433c5a211a8e56758c90d0eaf..742a8457017c55a49c95301ae8a94f58ae6ba191 100644 (file)
@@ -107,6 +107,12 @@ match 1970-01-10T00:00:00Z
 calc date "Jan 11 1970 00:00:00 UTC" -  time_delta 1d -> date
 match 1970-01-10T00:00:00Z
 
+#
+#  The default output for time delta is seconds.
+#
+calc date "Jan 11 1970 00:00:00 UTC" - date "Jan 1 1970 00:00:00 UTC" -> uint32
+match 864000
+
 #
 #  Comparisons don't need output data types
 #
@@ -213,4 +219,4 @@ calc string "2" += string "test"
 match 2test
 
 count
-match 98
+match 100