using testify instead of testing.T methods. (#143)

This commit is contained in:
K
2024-09-09 13:50:56 +03:30
committed by GitHub
parent b2692a2584
commit c91e7b9765
21 changed files with 473 additions and 643 deletions

View File

@@ -2,6 +2,8 @@ package nostr
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsValidRelayURL(t *testing.T) {
@@ -15,14 +17,10 @@ func TestIsValidRelayURL(t *testing.T) {
{"wss://relay.nostr.com", true},
{"http://127.0.0.1", false},
{"127.0.0.1", false},
//{"wss://relay.nostr.com'", false},
//{"wss://relay.nostr.com'hiphop", true},
}
for _, test := range tests {
got := IsValidRelayURL(test.u)
if got != test.want {
t.Errorf("IsValidRelayURL want %v for %q but got %v", test.want, test.u, got)
}
assert.Equal(t, test.want, got)
}
}