]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add more xlat_expr run-time tests
authorAlan T. DeKok <aland@freeradius.org>
Wed, 9 Feb 2022 21:02:43 +0000 (16:02 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 9 Feb 2022 21:02:43 +0000 (16:02 -0500)
src/tests/xlat/expr.txt

index 60995b755ca0e740f7764b1090548db79607fff8..b036027268515271bcc9ddfa370012ee00d3ccb4 100644 (file)
@@ -1,5 +1,32 @@
 xlat_expr 1 && 2
 match yes
 
-#xlat_expr 1 < 2
-#match yes
+xlat_expr 1 < 2
+match yes
+
+xlat_expr 1 + 2
+match 3
+
+xlat_expr (ipv4prefix) 192.168.0.0/16 + 4
+match 192.168.0.4
+
+#
+#  This crashes right now, because "foo" is marked up as needing xlat expansion.  it doesn't, but
+#  the rest of the code tries to bootstrap it, and unit_test_module doesn't do thread
+#  instantiation of xlats.
+#
+#  and if that's fixed, xlat_eval() needs to be fixed to handle this data type.
+#
+#xlat_expr "foo"
+#match "foo"
+
+#  This crashes, too.
+#
+#xlat_expr "foo" + "bar"
+#match "foobar"
+
+xlat_expr 0xabcdef + 0x1234
+match 0xabcdef1234
+
+xlat_expr 2 ^ 4
+match 6