Sasha Smundak | 24159db | 2020-10-26 15:43:21 -0700 | [diff] [blame] | 1 | # Tests rblf_regex |
2 | load("assert.star", "assert") | ||||
3 | |||||
4 | |||||
5 | def 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 | |||||
13 | test() |