mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 13:22:56 +01:00
24 lines
560 B
Go
24 lines
560 B
Go
package nip54
|
|
|
|
import (
|
|
"fmt"
|
|
"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)
|
|
}
|
|
}
|
|
}
|