1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Oinktube/node_modules/unordered-array-remove/test.js
2023-02-17 15:04:26 -03:00

22 lines
415 B
JavaScript

var tape = require('tape')
var remove = require('./')
tape('remove', function (t) {
var list = [0, 1, 2]
remove(list, 1)
t.same(list.sort(), [0, 2])
remove(list, 0)
t.same(list.sort(), [2])
remove(list, 0)
t.same(list, [])
t.end()
})
tape('out of bounds', function (t) {
var list = [0, 1, 2]
remove(list, 42)
t.same(list, [0, 1, 2])
remove(list, -1)
t.same(list, [0, 1, 2])
t.end()
})