aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/dnsutil/join_test.go
blob: 26eeb58979189499df59fdae0259a02c3bc7605f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package dnsutil

import "testing"

func TestJoin(t *testing.T) {
	tests := []struct {
		in  []string
		out string
	}{
		{[]string{"bla", "bliep", "example", "org"}, "bla.bliep.example.org."},
		{[]string{"example", "."}, "example."},
		{[]string{"."}, "."},
	}

	for i, tc := range tests {
		if x := Join(tc.in); x != tc.out {
			t.Errorf("Test %d, expected %s, got %s", i, tc.out, x)
		}
	}
}