Created
March 2, 2016 18:12
-
-
Save codedmart/1dc7e38ab7d64aea6465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert') | |
var inversions = require('Inversions').inversions | |
var list = require('Data.List') | |
describe('The inversion counting function', function() { | |
it('should find an inversion', function () { | |
assert.equal(inversions(list.Cons.create(1)(list.Cons.create(2)(list.Cons.create(3)(list.Cons.create(4)(list.Nil.value))))), 0) | |
assert.equal(inversions(list.Cons.create(2)(list.Cons.create(1)(list.Cons.create(3)(list.Cons.create(4)(list.Nil.value))))), 1) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment