aboutsummaryrefslogtreecommitdiff
path: root/models/infohash_test.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2018-03-13 11:29:49 +0000
committerFelix Hanley <felix@userspace.com.au>2018-03-13 11:29:49 +0000
commit79c6a22d81e6ceadb23636e90e5d53f2a86e090d (patch)
tree33776c9bedc99ccd87c1c7061b6195500c05f54d /models/infohash_test.go
parenta67075e332458002ce4c56c0aa07e03807dc22ea (diff)
downloaddhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.gz
dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.bz2
Fix tagging and announce callbacks
Diffstat (limited to 'models/infohash_test.go')
-rw-r--r--models/infohash_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/infohash_test.go b/models/infohash_test.go
index e855e35..c1d9cca 100644
--- a/models/infohash_test.go
+++ b/models/infohash_test.go
@@ -30,6 +30,15 @@ func TestInfohashImport(t *testing.T) {
if !ih.Equal(ih2) {
t.Errorf("expected %s to equal %s", ih, ih2)
}
+ if ih.String() != tt.str {
+ t.Errorf("expected ih.String() to equal %s, got %s", tt.str, ih.String())
+ }
+ byt := ih.Bytes()
+ for i := range byt {
+ if byt[i] != []byte(tt.str)[i] {
+ t.Errorf("expected ih.Bytes() to equal %s, got %s", []byte(tt.str), ih.Bytes())
+ }
+ }
} else {
if err == nil {
t.Errorf("FromString should have failed for %s", tt.str)