aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/uri_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/api/uri_test.go')
-rw-r--r--swarm/api/uri_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/swarm/api/uri_test.go b/swarm/api/uri_test.go
index babb2834e..137b4505d 100644
--- a/swarm/api/uri_test.go
+++ b/swarm/api/uri_test.go
@@ -29,6 +29,7 @@ func TestParseURI(t *testing.T) {
expectRaw bool
expectImmutable bool
expectList bool
+ expectHash bool
expectDeprecatedRaw bool
expectDeprecatedImmutable bool
}
@@ -99,6 +100,16 @@ func TestParseURI(t *testing.T) {
expectURI: &URI{Scheme: "bzz", Addr: "abc123", Path: "path/to/entry"},
},
{
+ uri: "bzz-hash:",
+ expectURI: &URI{Scheme: "bzz-hash"},
+ expectHash: true,
+ },
+ {
+ uri: "bzz-hash:/",
+ expectURI: &URI{Scheme: "bzz-hash"},
+ expectHash: true,
+ },
+ {
uri: "bzz-list:",
expectURI: &URI{Scheme: "bzz-list"},
expectList: true,
@@ -152,6 +163,9 @@ func TestParseURI(t *testing.T) {
if actual.List() != x.expectList {
t.Fatalf("expected %s list to be %t, got %t", x.uri, x.expectList, actual.List())
}
+ if actual.Hash() != x.expectHash {
+ t.Fatalf("expected %s hash to be %t, got %t", x.uri, x.expectHash, actual.Hash())
+ }
if actual.DeprecatedRaw() != x.expectDeprecatedRaw {
t.Fatalf("expected %s deprecated raw to be %t, got %t", x.uri, x.expectDeprecatedRaw, actual.DeprecatedRaw())
}