add test for equal

This commit is contained in:
Stefan Feješ
2018-02-04 21:37:37 +01:00
parent 998af8f9e2
commit 307d4bccfb

View File

@ -8,6 +8,7 @@ test('Testing binarySearch', (t) => {
//t.deepEqual(binarySearch(args..), 'Expected');
t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6), 2, 'Finds item in array');
t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21), -1, 'Returns -1 when not found');
t.equal(binarySearch([], 21), -1, 'Works with empty arrays');
//t.false(binarySearch(args..), 'Expected');
//t.throws(binarySearch(args..), 'Expected');
t.end();