fixing names
This commit is contained in:
parent
90fdc7aa06
commit
17b5708d59
12 changed files with 10 additions and 22 deletions
22
src/__tests__/Stack.ts
Normal file
22
src/__tests__/Stack.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import Stack from "@code/stack";
|
||||
|
||||
test("queue", function() {
|
||||
const list = new Stack<number>();
|
||||
|
||||
list.push(5);
|
||||
list.push(7);
|
||||
list.push(9);
|
||||
|
||||
expect(list.pop()).toEqual(9);
|
||||
expect(list.length).toEqual(2);
|
||||
|
||||
list.push(11);
|
||||
expect(list.pop()).toEqual(11);
|
||||
expect(list.pop()).toEqual(7);
|
||||
expect(list.peek()).toEqual(5);
|
||||
expect(list.pop()).toEqual(5);
|
||||
expect(list.pop()).toEqual(undefined);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue