Merge remote-tracking branch 'origin/topic/awelzel/4084-vector-of-pattern-compare'

* origin/topic/awelzel/4084-vector-of-pattern-compare:
  ZAM/relexpr-op NE for patterns
  Expr: Fix folding of pattern values to support == and !=
This commit is contained in:
Tim Wojtulewicz 2024-12-16 12:37:25 -07:00
commit 33eaa5ccda
7 changed files with 35 additions and 7 deletions

View file

@ -84,3 +84,5 @@ negative index (PASS)
negative index (PASS)
+= of empty vector (PASS)
+= of empty vector (PASS)
pv1 == pv2 -> [T, F] (PASS)
pv1 != pv2 -> [F, T] (PASS)

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
1248 valid, 1890 tested, 437 skipped
1255 valid, 1908 tested, 440 skipped

View file

@ -241,4 +241,11 @@ event zeek_init()
v26 += vector();
test_case( "+= of empty vector", |v26| == 0 );
# Pattern vectors
local pv1 = vector(/a/, /b/);
local pv2 = vector(/a/, /c/);
local pv_eq = pv1 == pv2;
local pv_ne = pv1 != pv2;
test_case( fmt("pv1 == pv2 -> %s", pv_eq), (pv_eq[0] == T) && (pv_eq[1] == F) );
test_case( fmt("pv1 != pv2 -> %s", pv_ne), (pv_ne[0] == F) && (pv_ne[1] == T) );
}