Skip to content

Commit

Permalink
#234 Added more test case as review comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzhang6222 committed May 21, 2020
1 parent 5e4fca9 commit 1cf5725
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions syntax/std_seq_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ func TestArrayJoin(t *testing.T) {
AssertCodesEvalToSameValue(t, `[[1, 2], [3, 4], [0], [1], [5, 6], [7, 8]]`,
`//seq.join([[0],[1]], [[[1, 2], [3, 4]],[[5, 6],[7, 8]]])`)

// Test cases the delimiter is []
AssertCodesEvalToSameValue(t, `[1,2]`, `//seq.join([],[1,2])`)
AssertCodesEvalToSameValue(t, `[]`, `//seq.join([],[])`)
AssertCodesEvalToSameValue(t, `[]`, `//seq.join([1],[])`)

AssertCodesEvalToSameValue(t, `[1, 2, 3, 4]`, `//seq.join([], [[1, 2], [3, 4]])`)
AssertCodesEvalToSameValue(t, `[[1, 2], 3, 4]`, `//seq.join([], [[[1, 2]], [3, 4]])`)
AssertCodesEvalToSameValue(t, `[[1, 2], [3, 4], 5]`, `//seq.join([], [[[1, 2]], [[3,4], 5]])`)

assertExprPanics(t, `//seq.join(1, [1,2,3,4,5])`)
assertExprPanics(t, `//seq.join('A', [1,2])`)
Expand Down

0 comments on commit 1cf5725

Please sign in to comment.