diff --git a/did.go b/did.go index 5ad8d7c..4331aec 100644 --- a/did.go +++ b/did.go @@ -328,7 +328,7 @@ func (p *parser) parsePath() parserStep { // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" if !percentEncoded && isNotValidPathChar(char) { - return p.errorf(currentIndex, "character is not allowed in fragment") + return p.errorf(currentIndex, "character is not allowed in path") } // move to the next char diff --git a/did_test.go b/did_test.go index 74f8a84..ab18dbc 100644 --- a/did_test.go +++ b/did_test.go @@ -6,7 +6,7 @@ import ( func TestIsReference(t *testing.T) { - t.Run("returns false if no Path of Fragment", func(t *testing.T) { + t.Run("returns false if no Path or Fragment", func(t *testing.T) { d := &DID{Method: "example", ID: "123"} if d.IsReference() { t.Errorf("returned true") @@ -276,7 +276,7 @@ func TestParse(t *testing.T) { } }) - t.Run("fails of ID has an invalid char", func(t *testing.T) { + t.Run("fails if ID has an invalid char", func(t *testing.T) { _, err := Parse("did:a:1&&111") if err == nil { t.Errorf("error is nil") @@ -360,7 +360,7 @@ func TestParse(t *testing.T) { } }) - t.Run("does not fail if path has atleast on segment and a trailing slash", func(t *testing.T) { + t.Run("does not fail if path has atleast one segment and a trailing slash", func(t *testing.T) { _, err := Parse("did:a:123:456/a/b/") if err != nil { t.Errorf("error is not nil - %+v", err)