From ba5c0057ed01fb006b7a6fb1bd8c21f0c9ae12be Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sat, 22 May 2010 22:47:24 +0200 Subject: Extends pair set syntax, matching and deleting against clist. Expressions like (123,*) can be used in pair set literals, clists can be matched against pair sets (community ~ pairset) and pair sets can be used to specify items to delete from clists (community.delete(pairset)). --- filter/test.conf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'filter/test.conf') diff --git a/filter/test.conf b/filter/test.conf index aca049c..4814396 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -79,10 +79,11 @@ clist l; l = add( l, (1,2) ); l = add( l, (2,3) ); print "Community list (1,2) (2,3) ", l; - print "Should be true: ", (2,3) ~ l; - l = delete( l, (2,3) ); + print "Should be true: ", (2,3) ~ l, " ", l ~ [(1,*)], " ", l ~ [(2,3)]; + l = add( l, (2,5) ); + l = delete( l, [(2,*)] ); print "Community list (1,2) ", l; - print "Should be false: ", (2,3) ~ l; + print "Should be false: ", (2,3) ~ l, " ", l ~ [(2,*)]; } function bla() @@ -196,8 +197,9 @@ string s; ", true: ", RTS_STATIC ~ [RTS_STATIC, RTS_DEVICE], ", false: ", RTS_BGP ~ [RTS_STATIC, RTS_DEVICE]; - ps = [(1,2), (3,4)..(3,8)]; - print "Testing pair set (TTF):", pp ~ ps, " ", (3,5) ~ ps, " ", (3,9) ~ ps; + ps = [(1,2), (3,4)..(4,8), (5,*)]; + print "Testing pair set, true: ", pp ~ ps, " ", (3,5) ~ ps, " ", (4,1) ~ ps, " ", (5,4) ~ ps, " ", (5,65535) ~ ps; + print "Testing pair set, false: ", (3,3) ~ ps, " ", (4,9) ~ ps, " ", (4,65535) ~ ps, " ", (6,0) ~ ps ; qq = 1.2.3.4; print "Testinq quad: 1.2.3.4 = ", qq, -- cgit v1.2.3