From d8b12cf17a43e700d841402f712efa8666e6137f Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 5 May 2022 21:42:46 -0600 Subject: Begin work on post package --- srv/src/post/post_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 srv/src/post/post_test.go (limited to 'srv/src/post/post_test.go') 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])) + }) + } +} -- cgit v1.2.3