A fast and simple blog backend.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mediocre-blog/srv/src/post/post_test.go

32 lines
497 B

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]))
})
}
}