From 74266996792c5abc598251334ad40eaf72565044 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 26 Sep 2019 22:22:13 +0900 Subject: table: add NewSingleAsPathMatch unittest Signed-off-by: FUJITA Tomonori --- internal/pkg/table/policy_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/pkg/table') diff --git a/internal/pkg/table/policy_test.go b/internal/pkg/table/policy_test.go index c67470ef..7c2d7a64 100644 --- a/internal/pkg/table/policy_test.go +++ b/internal/pkg/table/policy_test.go @@ -3179,3 +3179,14 @@ func TestMultipleStatementPolicy(t *testing.T) { localPref, _ := newPath.GetLocalPref() assert.Equal(t, localPref, uint32(100)) } + +func TestNewSingleAsPathMatch(t *testing.T) { + r := NewSingleAsPathMatch("^65100_") + assert.Equal(t, r.mode, LEFT_MOST) + r = NewSingleAsPathMatch("_65100$") + assert.Equal(t, r.mode, ORIGIN) + r = NewSingleAsPathMatch("_65100_") + assert.Equal(t, r.mode, INCLUDE) + r = NewSingleAsPathMatch("^65100$") + assert.Equal(t, r.mode, ONLY) +} -- cgit v1.2.3