Mercurial > hg > ugly-duckling
comparison lib-tests/spec/session.spec.ts @ 509:041468f553e1 tip master
Merge pull request #57 from LucasThompson/fix/session-stack-max-call-stack
Fix accidental recursion in PersistentStack
author | Lucas Thompson <LucasThompson@users.noreply.github.com> |
---|---|
date | Mon, 27 Nov 2017 11:04:30 +0000 |
parents | 7ac80ad913c1 |
children |
comparison
equal
deleted
inserted
replaced
507:0e6d4f994b73 | 509:041468f553e1 |
---|---|
1 import { PersistentStack } from '../../src/app/Session'; | |
2 import * as jasmine from 'jasmine-core'; | |
3 | |
4 describe('PersistentStack', () => { | |
5 it('can add values to the front and maintain undo history', () => { | |
6 const stack = new PersistentStack<number>(); | |
7 stack.unshift(1); | |
8 stack.unshift(2); | |
9 expect(stack.get(0)).toBe(2); | |
10 expect(stack.get(1)).toBe(1); | |
11 stack.stepBack(); | |
12 expect(stack.get(0)).toBe(1); | |
13 expect(stack.get(1)).toBeUndefined(); | |
14 }); | |
15 }); | |
16 |