]>
Commit | Line | Data |
---|---|---|
cb5a452c PK |
1 | /** |
2 | * @license MIT | |
3 | */ | |
4 | import { assert } from 'chai'; | |
5 | import { ITerminal } from './Interfaces'; | |
6 | import { Buffer } from './Buffer'; | |
7 | import { CircularList } from './utils/CircularList'; | |
8 | ||
9 | describe('Buffer', () => { | |
10 | let terminal: ITerminal; | |
11 | let buffer: Buffer; | |
12 | ||
13 | beforeEach(() => { | |
14 | terminal = <any>{ | |
15 | cols: 80, | |
16 | rows: 24, | |
17 | scrollback: 1000 | |
18 | }; | |
19 | buffer = new Buffer(terminal); | |
20 | }); | |
21 | ||
22 | describe('constructor', () => { | |
23 | it('should create a CircularList with max length equal to scrollback, for its lines', () => { | |
24 | assert.instanceOf(buffer.lines, CircularList); | |
25 | assert.equal(buffer.lines.maxLength, terminal.scrollback); | |
26 | }); | |
27 | it('should set the Buffer\'s scrollBottom value equal to the terminal\'s rows -1', () => { | |
28 | assert.equal(buffer.scrollBottom, terminal.rows - 1); | |
29 | }); | |
30 | }); | |
31 | }); |