aboutsummaryrefslogtreecommitdiff
path: root/main_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-05-01 16:57:53 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-05-01 16:57:53 +0200
commiteae17147e143094e48050494b2da570f42d21986 (patch)
treeeecf454787918d8f9a07f630b60b8dbe75fb7540 /main_test.go
parentd8bd486761d8e90b06a37b0658f81a2ebf3be9a8 (diff)
Reorder package
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go
new file mode 100644
index 0000000..1e8d0e5
--- /dev/null
+++ b/main_test.go
@@ -0,0 +1,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)
+ }
+ })
+ }
+}