single_test.go 321 B

12345678910111213141516
  1. package addrgen
  2. import (
  3. "math/big"
  4. "testing"
  5. )
  6. func TestSingleAddr(t *testing.T) {
  7. s := "example.com"
  8. if r := SingleAddr(s).Addr(); r != s {
  9. t.Errorf("expected: %q, got: %q", s, r)
  10. }
  11. if r := SingleAddr(s).Power(); big.NewInt(1).Cmp(r) != 0 {
  12. t.Errorf("expected: %s, got: %s", big.NewInt(1).String(), r)
  13. }
  14. }