From: Ondrej Zajicek Date: Tue, 1 Jul 2025 14:43:18 +0000 (+0200) Subject: Filter: Add more tests for append operator X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fbird.git Filter: Add more tests for append operator --- diff --git a/filter/test.conf b/filter/test.conf index 0540b111a..09d727c15 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -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");