Skip to content

Commit

Permalink
Increase coverage for json_fold.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshi-garg1 authored Jan 22, 2025
1 parent 13140eb commit f9c5d1d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions api/json/json_fold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func TestFoldFunc(t *testing.T) {

s = []byte("K")
_ = foldFunc(s)

s = []byte("123")
_ = foldFunc(s)
}

func TestEqualFoldRight(t *testing.T) {
Expand All @@ -27,6 +30,18 @@ func TestEqualFoldRight(t *testing.T) {
s = []byte("123")
t1 = []byte("123")
assert.True(t, equalFoldRight(s, t1))

s = []byte("123")
t1 = []byte("")
assert.False(t, equalFoldRight(s, t1))

s = []byte("123")
t1 = []byte("abc")
assert.False(t, equalFoldRight(s, t1))

s = []byte("")
t1 = []byte("abc")
assert.False(t, equalFoldRight(s, t1))
}

func TestASCIIEqualFold(t *testing.T) {
Expand All @@ -44,6 +59,14 @@ func TestASCIIEqualFold(t *testing.T) {

t1 = []byte("1234")
assert.False(t, asciiEqualFold(s, t1))

s = []byte("abc")
t1 = []byte("ZWR")
assert.False(t, asciiEqualFold(s, t1))

s = []byte("123")
t1 = []byte("abc")
assert.False(t, asciiEqualFold(s, t1))
}

func TestSimpleLetterEqualFold(t *testing.T) {
Expand Down

0 comments on commit f9c5d1d

Please sign in to comment.