Skip to content

Commit

Permalink
fix tests"
Browse files Browse the repository at this point in the history
  • Loading branch information
iamskp11 committed Dec 3, 2024
1 parent 4e0d600 commit 4bf67bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions integration_tests/commands/resp/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1790,15 +1790,15 @@ func TestJSONARRINDEX(t *testing.T) {
assertType: []string{"equal", "deep_equal"},
},
{
name: "should handle stop index - 0 which should be last index",
name: "should handle stop index - 0 which should be last index inclusive",
commands: []string{"json.set key $ " + nestedArray, "json.arrindex key $..arr 3 1 0", "json.arrindex key $..arr 3 2 0"},
expected: []interface{}{"OK", []interface{}{int64(2), int64(1), int64(-1)}, []interface{}{int64(2), int64(-1), int64(-1)}},
assertType: []string{"equal", "deep_equal", "deep_equal"},
},
{
name: "should handle stop index - -1 which should be last index",
name: "should handle stop index - -1 which should be last index exclusive",
commands: []string{"json.set key $ " + nestedArray, "json.arrindex key $..arr 3 1 -1", "json.arrindex key $..arr 3 2 -1"},
expected: []interface{}{"OK", []interface{}{int64(2), int64(1), int64(-1)}, []interface{}{int64(2), int64(-1), int64(-1)}},
expected: []interface{}{"OK", []interface{}{int64(-1), int64(1), int64(-1)}, []interface{}{int64(-1), int64(-1), int64(-1)}},
assertType: []string{"equal", "deep_equal", "deep_equal"},
},
{
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/commands/websocket/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ func TestJSONARRINDEX(t *testing.T) {
{
name: "should handle stop index - -1 which should be last index",
commands: []string{"json.set key $ " + nestedArray, "json.arrindex key $..arr 3 1 -1", "json.arrindex key $..arr 3 2 -1"},
expected: []interface{}{"OK", []interface{}{float64(2), float64(1), float64(-1)}, []interface{}{float64(2), float64(-1), float64(-1)}},
expected: []interface{}{"OK", []interface{}{float64(-1), float64(1), float64(-1)}, []interface{}{float64(-1), float64(-1), float64(-1)}},
assertType: []string{"equal", "deep_equal", "deep_equal"},
cleanUp: []string{"DEL key"},
},
Expand Down

0 comments on commit 4bf67bf

Please sign in to comment.