From d6857be8f040d78aada3648ba4535e2bffbdc9c6 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 20 Apr 2016 09:32:19 +0900 Subject: policy: add unittest ParseCommunityRegexp() Signed-off-by: FUJITA Tomonori --- table/policy_test.go | 7 +++++++ 1 file changed, 7 insertions(+) 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{ -- cgit v1.2.3