diff options
Diffstat (limited to 'srv/src/post/post_test.go')
-rw-r--r-- | srv/src/post/post_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/srv/src/post/post_test.go b/srv/src/post/post_test.go new file mode 100644 index 0000000..47c9ae8 --- /dev/null +++ b/srv/src/post/post_test.go @@ -0,0 +1,32 @@ +package post + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestNewID(t *testing.T) { + + tests := [][2]string{ + { + "Why Do We Have WiFi Passwords?", + "why-do-we-have-wifi-passwords", + }, + { + "Ginger: A Small VM Update", + "ginger-a-small-vm-update", + }, + { + "Something-Weird.... woah!", + "somethingweird-woah", + }, + } + + for i, test := range tests { + t.Run(strconv.Itoa(i), func(t *testing.T) { + assert.Equal(t, test[1], NewID(test[0])) + }) + } +} |