nip54: bring back normalization test.
This commit is contained in:
@@ -1,10 +1,28 @@
|
|||||||
package nip54
|
package nip54
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestNormalization(t *testing.T) {
|
||||||
|
for _, vector := range []struct {
|
||||||
|
before string
|
||||||
|
after string
|
||||||
|
}{
|
||||||
|
{" hello ", "hello"},
|
||||||
|
{"Goodbye", "goodbye"},
|
||||||
|
{"the long and winding road / that leads to your door", "the-long-and-winding-road---that-leads-to-your-door"},
|
||||||
|
{"it's 平仮名", "it-s-平仮名"},
|
||||||
|
} {
|
||||||
|
if norm := NormalizeIdentifier(vector.before); norm != vector.after {
|
||||||
|
fmt.Println([]byte(vector.after), []byte(norm))
|
||||||
|
t.Fatalf("%s: %s != %s", vector.before, norm, vector.after)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestArticleAsHTML(t *testing.T) {
|
func TestArticleAsHTML(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|||||||
Reference in New Issue
Block a user