addyosmani / selectionsort

Selection sort with O(n^2) time complexity
56 stars 5 forks source link

wrong usage of assert #4

Closed stoeffel closed 9 years ago

stoeffel commented 9 years ago

Some of the tests will never fail, because assert is used wrong. The API of assert is: assert(value, message) but in the tests it was used like this assert(actual, expected) (checkout http://nodejs.org/api/assert.html).

When I changed some of the tests to assert.deepEqual they failed. I will submit a PR to fix the tests.

stoeffel commented 9 years ago

The failing test was:

1) selectionsort node module should work with sorted arrays:
     AssertionError: [-5,-5,-5,-5,2,2,12,14] deepEqual [-5,1,2,5,12,12,14,16]
addyosmani commented 9 years ago

Thanks for fixing this!

stoeffel commented 9 years ago

No problem :smile: