Skip to content

Commit cfbc7ea

Browse files
committed
update unit tests
1 parent 9746c38 commit cfbc7ea

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('slice', function(a)
3131
a.equal(#array.slice({}, 1, 2), 0)
3232

3333
a.deep_equal(
34-
array.slice({ 'lua', 'javascript', 'python', 'ruby', 'c' }, 2, 4),
34+
array.slice({ 'lua', 'javascript', 'python', 'ruby', 'c' }, 2, 5),
3535
{ 'javascript', 'python', 'ruby' }
3636
)
3737

@@ -133,6 +133,11 @@ test('concat', function(a)
133133
{ 1, 2, 3, 4, 5, 6 }
134134
)
135135

136+
a.deep_equal(
137+
array.concat({ 'a', 'b', 'c' }, { 'd', 'e' }, { 'f', 'g' }),
138+
{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' }
139+
)
140+
136141
a.deep_equal(
137142
array.concat({ 1, 2, 3 }, { 4, 5 }, { 6, 7 }, { 8, 9 }),
138143
{ 1, 2, 3, 4, 5, 6, 7, 8, 9 }
@@ -376,4 +381,16 @@ test('permutation', function(a)
376381
{ 'javascript', 'lua' },
377382
}
378383
)
384+
385+
a.deep_equal(
386+
array.permutation({ 'lua', 'javascript', 'ruby' }),
387+
{
388+
{ 'lua', 'javascript', 'ruby' },
389+
{ 'javascript', 'lua', 'ruby' },
390+
{ 'javascript', 'ruby', 'lua' },
391+
{ 'lua', 'ruby', 'javascript' },
392+
{ 'ruby', 'lua', 'javascript' },
393+
{ 'ruby', 'javascript', 'lua' },
394+
}
395+
)
379396
end)

0 commit comments

Comments
 (0)