summaryrefslogtreecommitdiff
path: root/srv/src/post/post_test.go
blob: 47c9ae8a73d819d4e013dc2057035a708ad6d266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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]))
		})
	}
}