Skip to content

Commit

Permalink
Add hasher test
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed Nov 3, 2018
1 parent a51128d commit 5613c47
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 4,346 deletions.
13 changes: 2 additions & 11 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions domain/hasher_test.go
@@ -0,0 +1,30 @@
package domain

import (
"testing"

"github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
)

var (
testNodeType1 = "sidecar"
testNodeType2 = "router"
testNodeType3 = "ingress"
testNode1 = &core.Node{Id: testNodeType1 + "-app1"}
testNode2 = &core.Node{Id: testNodeType2 + "-app1"}
testNode3 = &core.Node{Id: testNodeType3 + "-app1"}
)

func TestID(t *testing.T) {
hasher := &Hasher{}

if got, want := hasher.ID(testNode1), testNodeType1; got != want {
t.Fatalf("got %v, want %v", got, want)
}
if got, want := hasher.ID(testNode2), testNodeType2; got != want {
t.Fatalf("got %v, want %v", got, want)
}
if got, want := hasher.ID(testNode3), testNodeType3; got != want {
t.Fatalf("got %v, want %v", got, want)
}
}
13 changes: 0 additions & 13 deletions vendor/github.com/stretchr/objx/.codeclimate.yml

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/stretchr/objx/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/github.com/stretchr/objx/.travis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions vendor/github.com/stretchr/objx/Gopkg.lock

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/github.com/stretchr/objx/Gopkg.toml

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/github.com/stretchr/objx/LICENSE

This file was deleted.

80 changes: 0 additions & 80 deletions vendor/github.com/stretchr/objx/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions vendor/github.com/stretchr/objx/Taskfile.yml

This file was deleted.

0 comments on commit 5613c47

Please sign in to comment.