Files
next.orly.dev/pkg/utils/normalize/normalize_test.go
mleku 8add32bb78 Add relayinfo package and utility modules for NIP-11 support
Introduce the `relayinfo` package with `NIP-11` utilities, including `Fees`, `Limits`, and `NIPs` structures. Add utility modules for handling numbers, timestamps, and kinds. Integrate functionality for fetching and managing relay information.
2025-08-21 15:22:17 +01:00

36 lines
780 B
Go

package normalize
import (
"fmt"
"testing"
)
func TestURL(t *testing.T) {
fmt.Println(URL([]byte("")))
fmt.Println(URL([]byte("wss://x.com/y")))
fmt.Println(URL([]byte("wss://x.com/y/")))
fmt.Println(URL([]byte("http://x.com/y")))
fmt.Println(URL(URL([]byte("http://x.com/y"))))
fmt.Println(URL([]byte("wss://x.com")))
fmt.Println(URL([]byte("wss://x.com/")))
fmt.Println(URL(URL(URL([]byte("wss://x.com/")))))
fmt.Println(URL([]byte("x.com")))
fmt.Println(URL([]byte("x.com/")))
fmt.Println(URL([]byte("x.com////")))
fmt.Println(URL([]byte("x.com/?x=23")))
// Output:
//
// wss://x.com/y
// wss://x.com/y
// ws://x.com/y
// ws://x.com/y
// wss://x.com
// wss://x.com
// wss://x.com
// wss://x.com
// wss://x.com
// wss://x.com
// wss://x.com?x=23
}