2016-12-07 18:46:22 +03:00
|
|
|
package lnwire
|
|
|
|
|
2017-04-20 02:16:55 +03:00
|
|
|
import "testing"
|
2017-02-17 12:29:23 +03:00
|
|
|
|
|
|
|
func TestValidateAlias(t *testing.T) {
|
2017-04-20 02:16:55 +03:00
|
|
|
aliasStr := "012345678901234567890"
|
|
|
|
alias := NewAlias(aliasStr)
|
|
|
|
if err := alias.Validate(); err != nil {
|
2017-02-17 12:29:23 +03:00
|
|
|
t.Fatalf("alias was invalid: %v", err)
|
2016-12-24 23:46:42 +03:00
|
|
|
}
|
2017-04-20 02:16:55 +03:00
|
|
|
if aliasStr != alias.String() {
|
|
|
|
t.Fatalf("aliases don't match")
|
|
|
|
}
|
2016-12-24 23:46:42 +03:00
|
|
|
}
|