Mercurial > hg > ugly-duckling
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-tests/spec/session.spec.ts Mon Nov 27 11:04:30 2017 +0000 @@ -0,0 +1,16 @@ +import { PersistentStack } from '../../src/app/Session'; +import * as jasmine from 'jasmine-core'; + +describe('PersistentStack', () => { + it('can add values to the front and maintain undo history', () => { + const stack = new PersistentStack<number>(); + stack.unshift(1); + stack.unshift(2); + expect(stack.get(0)).toBe(2); + expect(stack.get(1)).toBe(1); + stack.stepBack(); + expect(stack.get(0)).toBe(1); + expect(stack.get(1)).toBeUndefined(); + }); +}); +