(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestKeyTranslation(t *testing.T) { |
| 13 | pid := test.RandPeerIDFatal(t) |
| 14 | pkname := namesys.PkRoutingKey(pid) |
| 15 | ipnsname := ipns.NameFromPeer(pid).RoutingKey() |
| 16 | |
| 17 | pkk, err := escapeDhtKey("/pk/" + pid.String()) |
| 18 | if err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | |
| 22 | ipnsk, err := escapeDhtKey("/ipns/" + pid.String()) |
| 23 | if err != nil { |
| 24 | t.Fatal(err) |
| 25 | } |
| 26 | |
| 27 | if pkk != pkname { |
| 28 | t.Fatal("keys didn't match!") |
| 29 | } |
| 30 | |
| 31 | if ipnsk != string(ipnsname) { |
| 32 | t.Fatal("keys didn't match!") |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected