aboutsummaryrefslogtreecommitdiff
path: root/cmd/signify/main_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/signify/main_test.go')
-rw-r--r--cmd/signify/main_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmd/signify/main_test.go b/cmd/signify/main_test.go
new file mode 100644
index 0000000..1e8d0e5
--- /dev/null
+++ b/cmd/signify/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)
+ }
+ })
+ }
+}