Documentation
¶
Index ¶
- func TestBinaryMarshaler[K interface{ ... }](t *testing.T, k K, newFunc func([]byte) K)
- type KeyTester
- func (kt *KeyTester[K]) RunTests(t *testing.T)
- func (kt *KeyTester[K]) TestBit(t *testing.T)
- func (kt *KeyTester[K]) TestBitString(t *testing.T)
- func (kt *KeyTester[K]) TestCommonPrefixLength(t *testing.T)
- func (kt *KeyTester[K]) TestCompare(t *testing.T)
- func (kt *KeyTester[K]) TestHexString(t *testing.T)
- func (kt *KeyTester[K]) TestXor(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KeyTester ¶
type KeyTester[K kad.Key[K]] struct { // Key 0 is zero Key0 K // Key1 is Key0 + 1 (00000...001) Key1 K // Key2 is Key0 + 2 (00000...010) Key2 K // Key1xor2 is Key1 ^ Key2 (00000...011) Key1xor2 K // Key100 is Key0 with the most significant bit set (10000...000) Key100 K // Key010 is Key0 with the second most significant bit set (01000...000) Key010 K // KeyX is a random key KeyX K }
KeyTester tests a kad.Key's implementation
func (*KeyTester[K]) TestBitString ¶
func (*KeyTester[K]) TestCommonPrefixLength ¶
func (*KeyTester[K]) TestCompare ¶
func (*KeyTester[K]) TestHexString ¶
Click to show internal directories.
Click to hide internal directories.