Skip to content

Commit

Permalink
table: add NewSingleAsPathMatch unittest
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
  • Loading branch information
fujita committed Sep 26, 2019
1 parent e193217 commit 7426699
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/pkg/table/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 7426699

Please sign in to comment.