]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Add more tests for append operator master oz-test
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 1 Jul 2025 14:43:18 +0000 (16:43 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 1 Jul 2025 14:43:44 +0000 (16:43 +0200)
filter/test.conf

index 0540b111a4a84c19d24d75fc5715ea0fc3086f1c..09d727c1541173c6bca366fb1bc4eda4d4128f50 100644 (file)
@@ -258,6 +258,10 @@ function t_string()
        bt_assert("abcd".append(format(1234)) = "abcd1234");
        bt_assert(append("He", "llo") = st);
        bt_assert("Hello" ++ " " ++ "world" = "Hello world");
+
+       bt_assert(st = "Hello");
+       st.append(" world");
+       bt_assert(st = "Hello world");
 }
 
 bt_test_suite(t_string, "Testing strings");
@@ -293,6 +297,10 @@ function t_bytestring()
        bt_assert(append(hex:01122334, hex:6778899a) = hex:011223346778899a);
        bt_assert(hex:01:12:23:34:45:56 ++ hex:67:78:89:9a:ab ++ hex:bc:cd:de:ef:f0 = bs2);
 
+       bs1 = hex:24:59:22:12;
+       bt_assert(bs1 = hex:24:59:22:12);
+       bs1.append(hex:01:23:45:67);
+       bt_assert(bs1 = hex:24:59:22:12:01:23:45:67);
 }
 
 bt_test_suite(t_bytestring, "Testing bytestrings");