1# Tests rblf_regex 2load("assert.star", "assert") 3 4 5def test(): 6 pattern = "^(foo.*bar|abc.*d|1.*)$" 7 for w in ("foobar", "fooxbar", "abcxd", "123"): 8 assert.true(rblf_regex(pattern, w), "%s should match %s" % (w, pattern)) 9 for w in ("afoobar", "abcde"): 10 assert.true(not rblf_regex(pattern, w), "%s should not match %s" % (w, pattern)) 11 12 13test() 14