aboutsummaryrefslogtreecommitdiff
path: root/main_test.go
blob: 1e8d0e515b96210265f92a6572852470becc6ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import "testing"

func TestNamingScheme(t *testing.T) {
	testCases := []struct {
		pub, sec string
		ok       bool
	}{
		{"key.pub", "key.sec", true},
		{"testdata/key.pub", "key.sec", true},
		{"key.pub", "testdata/key.sec", true},
		{"foo.pub", "bar.sec", false},
		{"key.foo", "key.bar", false},
	}
	for _, tc := range testCases {
		t.Run(tc.pub+"+"+tc.sec, func(t *testing.T) {
			ok := NamingScheme(tc.pub, tc.sec)
			if ok != tc.ok {
				t.Errorf("got %v, want %v", ok, tc.ok)
			}
		})
	}
}