Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
Fix various typos in comments and test descriptions.
  • Loading branch information
mrinalwadhwa committed Nov 8, 2018
1 parent 789947e commit d86bfee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion did.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions did_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d86bfee

Please sign in to comment.