diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-20 09:32:19 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-20 12:34:06 +0900 |
commit | d6857be8f040d78aada3648ba4535e2bffbdc9c6 (patch) | |
tree | a3c7d7b55489469422dabedffe2878bac231035b | |
parent | b7543a5ae05e41597b136fa4fc0cbd74ac99c345 (diff) |
policy: add unittest ParseCommunityRegexp()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | table/policy_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/table/policy_test.go b/table/policy_test.go index 71e1a723..106eb275 100644 --- a/table/policy_test.go +++ b/table/policy_test.go @@ -2647,6 +2647,13 @@ func TestPolicyAs4PathPrependLastAs(t *testing.T) { }, newPath.GetAsSeqList()) } +func TestParseCommunityRegexp(t *testing.T) { + exp, err := ParseCommunityRegexp("65000:1") + assert.Equal(t, nil, err) + assert.Equal(t, true, exp.MatchString("65000:1")) + assert.Equal(t, false, exp.MatchString("65000:100")) +} + func createStatement(name, psname, nsname string, accept bool) config.Statement { c := config.Conditions{ MatchPrefixSet: config.MatchPrefixSet{ |