en.javascript.info/1-js/4-data-structures/7-array-methods/11-array-unique/_js.view/test.js
Ilya Kantor 87bf53d076 update
2014-11-16 01:40:20 +03:00

14 lines
No EOL
636 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

describe("unique", function() {
it("убирает неуникальные элементы из массива", function() {
var strings = ["кришна", "кришна", "харе", "харе",
"харе", "харе", "кришна", "кришна", "8-()"];
assert.deepEqual( unique(strings), ["кришна", "харе", "8-()"] );
});
it("не изменяет исходный массив", function() {
var strings = ["кришна", "кришна", "харе", "харе"];
unique(strings);
assert.deepEqual( strings, ["кришна", "кришна", "харе", "харе"] );
});
});