feat: write some tests

This commit is contained in:
2023-11-04 11:38:48 +02:00
parent ac128d17f4
commit 0ae24148d8
9 changed files with 187 additions and 0 deletions

4
tests/array/sort.js Normal file
View File

@@ -0,0 +1,4 @@
return new UnitTest('concat', function() { return typeof Array.prototype.concat === 'function'; })
.add('two arrays', function() { return match([1, 2, 3], [1].concat([2], [3])) })
.add('simple spread', function() { return match([1, 2, 3, 4, 5], [1].concat([2], 3, [4, 5])) })
.add('sparse concat', function() { return match([1,, 2,,, 3,,, 4, 5], [1,,2].concat([,,3,,,4], 5)) })