From 6d9c53c8f8c9561c29c0ce8bce207234d2524fd1 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 20 Apr 2017 00:19:35 +0200 Subject: Naming Scheme --- cmd/signify/main_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cmd/signify/main_test.go (limited to 'cmd/signify/main_test.go') 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) + } + }) + } +} -- cgit v1.2.3