Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict'; |
||
11 | describe(`${pkg.name}/Parser/Parser`, () => { |
||
12 | /** @test {Parser#constructor} */ |
||
13 | describe('#constructor', () => { |
||
14 | it('Create a new instance of type Parser', () => { |
||
15 | const input = new Input('+Hello World'), |
||
16 | lexer = new Lexer(input), |
||
17 | parser = new Parser(lexer); |
||
18 | |||
19 | assert.instanceOf(parser, Parser); |
||
20 | }); |
||
21 | }); |
||
22 | |||
23 | /** @test {Parser#parse} */ |
||
24 | describe('#parse', () => { |
||
25 | it('Parse program', () => { |
||
26 | const code = fs.readFileSync(path.join(__dirname, '..', '..', 'example', 'hello_world.bot'), { |
||
27 | encoding : 'utf8', |
||
28 | flag : 'r' |
||
29 | }), |
||
30 | input = new Input(code), |
||
31 | lexer = new Lexer(input), |
||
32 | parser = new Parser(lexer); |
||
33 | |||
34 | assert.isObject(parser.parse()); |
||
35 | }); |
||
36 | }); |
||
37 | }); |
||
38 |