Merge pull request #15 from maxrzaw/fix-singly-linked-list
Fix Map and SinglyLinkedList tests and add SinglyLinkedList to ligma.config
This commit is contained in:
commit
c0ce0f15d9
3 changed files with 7 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ module.exports = {
|
||||||
"BinarySearchList",
|
"BinarySearchList",
|
||||||
"TwoCrystalBalls",
|
"TwoCrystalBalls",
|
||||||
"BubbleSort",
|
"BubbleSort",
|
||||||
|
"SinglyLinkedList",
|
||||||
"DoublyLinkedList",
|
"DoublyLinkedList",
|
||||||
"Queue",
|
"Queue",
|
||||||
"Stack",
|
"Stack",
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,15 @@ test("Map", function() {
|
||||||
map.set("bar", 69);
|
map.set("bar", 69);
|
||||||
expect(map.size()).toEqual(4);
|
expect(map.size()).toEqual(4);
|
||||||
|
|
||||||
console.log(map.size());
|
|
||||||
|
|
||||||
expect(map.get("bar")).toEqual(69);
|
expect(map.get("bar")).toEqual(69);
|
||||||
expect(map.get("blaz")).toEqual(undefined);
|
expect(map.get("blaz")).toEqual(undefined);
|
||||||
|
|
||||||
map.delete("bar")
|
map.delete("barblabr");
|
||||||
|
expect(map.size()).toEqual(4);
|
||||||
|
|
||||||
|
map.delete("bar");
|
||||||
expect(map.size()).toEqual(3);
|
expect(map.size()).toEqual(3);
|
||||||
map.delete("barblabr")
|
|
||||||
expect(map.size()).toEqual(2);
|
|
||||||
expect(map.get("bar")).toEqual(undefined);
|
expect(map.get("bar")).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import LinkedList from "@code/SingleLinkedList";
|
import SinglyLinkedList from "@code/SinglyLinkedList";
|
||||||
import { test_list } from "./ListTest";
|
import { test_list } from "./ListTest";
|
||||||
|
|
||||||
test("linked-list", function () {
|
test("linked-list", function () {
|
||||||
const list = new LinkedList<number>(3);
|
const list = new SinglyLinkedList<number>();
|
||||||
test_list(list);
|
test_list(list);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue