e3686cbc69
This commit does away with all the old manual message equality tests and replace it with a single property-based test that uses the testing/quick package. This test uses a single scenario which MUST hold for all the messages type and all possible messages generated for those types. As a result we are able to do away with all the prior manually generated test data as the fuzzer to scan the input space looking for a message that violates the scenario.
15 lines
297 B
Go
15 lines
297 B
Go
package lnwire
|
|
|
|
import "testing"
|
|
|
|
func TestValidateAlias(t *testing.T) {
|
|
aliasStr := "012345678901234567890"
|
|
alias := NewAlias(aliasStr)
|
|
if err := alias.Validate(); err != nil {
|
|
t.Fatalf("alias was invalid: %v", err)
|
|
}
|
|
if aliasStr != alias.String() {
|
|
t.Fatalf("aliases don't match")
|
|
}
|
|
}
|