feat: lru test just successed.
This commit is contained in:
parent
1a8319d427
commit
02a064b568
5 changed files with 10 additions and 6 deletions
|
|
@ -9,11 +9,9 @@ test("LRU", function () {
|
|||
|
||||
lru.update("bar", 420);
|
||||
expect(lru.get("bar")).toEqual(420);
|
||||
expect(lru.get("foo")).toEqual(69);
|
||||
|
||||
lru.update("baz", 1337);
|
||||
expect(lru.get("baz")).toEqual(1337);
|
||||
expect(lru.get("foo")).toEqual(69);
|
||||
|
||||
lru.update("ball", 69420);
|
||||
expect(lru.get("ball")).toEqual(69420);
|
||||
|
|
|
|||
6
src/global.d.ts
vendored
6
src/global.d.ts
vendored
|
|
@ -3,6 +3,12 @@ declare type Point = {
|
|||
y: number;
|
||||
}
|
||||
|
||||
declare type ListNode<T> = {
|
||||
value: T,
|
||||
next?: ListNode<T>,
|
||||
prev?: ListNode<T>,
|
||||
}
|
||||
|
||||
declare interface List<T> {
|
||||
get length(): number;
|
||||
removeAt(index: number): T | undefined;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue