aboutsummaryrefslogtreecommitdiff
path: root/file/names_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-05-01 17:28:38 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-05-01 17:28:38 +0200
commita3e526f9b89aa52c21cf8da02a5ddf6682795b1b (patch)
tree476fc4aa6c1e32cbd7c6e1454b9d1edffd099ac2 /file/names_test.go
parent6d570db777f841f23e6aef96a96992d20811cd44 (diff)
Names
Diffstat (limited to 'file/names_test.go')
-rw-r--r--file/names_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/file/names_test.go b/file/names_test.go
new file mode 100644
index 0000000..5c9941a
--- /dev/null
+++ b/file/names_test.go
@@ -0,0 +1,24 @@
+package file
+
+import "testing"
+
+func TestNames(t *testing.T) {
+ testCases := []struct {
+ pub, sec string
+ err error
+ }{
+ {"key.pub", "key.sec", nil},
+ {"testdata/key.pub", "key.sec", nil},
+ {"key.pub", "testdata/key.sec", nil},
+ {"foo.pub", "bar.sec", ErrNames},
+ {"key.foo", "key.bar", ErrNames},
+ }
+ for _, tc := range testCases {
+ t.Run(tc.pub+"+"+tc.sec, func(t *testing.T) {
+ err := Names(tc.pub, tc.sec)
+ if err != tc.err {
+ t.Errorf("got %v, want %v", err, tc.err)
+ }
+ })
+ }
+}