Commit 86e98e42 authored by flothoni's avatar flothoni Committed by Mikaël Salson
Browse files

qunit, add test for tools script and removeDuplicate function

Link to #4541
parent de17b2ae
...@@ -424,3 +424,15 @@ QUnit.test("Get n first sequences", function(assert) { ...@@ -424,3 +424,15 @@ QUnit.test("Get n first sequences", function(assert) {
assert.equal(getNFirstSequences(seqs, -1), seqs); assert.equal(getNFirstSequences(seqs, -1), seqs);
assert.equal(getNFirstSequences(seqs, 2), ">seq1\nAT\n>seq2\nTC\n"); assert.equal(getNFirstSequences(seqs, 2), ">seq1\nAT\n>seq2\nTC\n");
}); });
QUnit.test("remove duplicates", function(assert) {
var array = [1,2,3,4]
assert.deepEqual(removeDuplicate(array), [1,2,3,4], "correct array after removeDuplicate (1)")
var array = [4,3,2,1]
assert.deepEqual(removeDuplicate(array), [4,3,2,1], "correct array after removeDuplicate (2)")
var array = [0,1,2,3,6,7]
assert.deepEqual(removeDuplicate(array), [0,1,2,3,6,7], "correct array after removeDuplicate (3)")
var array = [0,1,2,3,3,3,4,0]
assert.deepEqual(removeDuplicate(array), [0,1,2,3,4], "correct array after removeDuplicate (4)")
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment