Skip to content

Commit c79d63a

Browse files
committed
glayzzle#41 update tests
1 parent 185adc9 commit c79d63a

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

test/functional/commentTests.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,27 @@ describe('Test comments', function() {
9494
});
9595
it('test class elements', function () {
9696
var body = ast[1][1][5];
97-
body.properties[0][0].should.be.exactly("comment");
98-
body.properties[0][1][0].should.be.exactly("// @var test\n");
99-
body.properties[0][2][1].should.be.exactly("$test");
10097

101-
body.properties[1][0].should.be.exactly("comment");
102-
body.properties[1][2][1].should.be.exactly("$toto");
98+
body[0][0].should.be.exactly("comment");
99+
body[0][1][0].should.be.exactly("// @var test\n");
103100

104-
body.properties[2][0].should.be.exactly("doc")
105-
body.properties[2][2][1].should.be.exactly("$foo");
101+
body[1][0].should.be.exactly("var");
102+
body[1][1].should.be.exactly("$test");
106103

107-
body.methods[0][0].should.be.exactly("doc");
108-
body.methods[0][1].should.be.exactly("/**\n * @return void\n */");
109-
body.methods[0][2][1].should.be.exactly("void");
104+
body[2][0].should.be.exactly("var");
105+
body[2][1].should.be.exactly("$toto");
106+
107+
body[3][0].should.be.exactly("comment");
108+
body[3][1][0].should.be.exactly("// ignored comment\n");
109+
110+
body[4][0].should.be.exactly("doc");
111+
body[4][1].should.be.exactly("/** @var Class */");
112+
113+
body[5][0].should.be.exactly("var");
114+
body[5][1].should.be.exactly("$foo");
115+
116+
body[8][0].should.be.exactly("method");
117+
body[8][1].should.be.exactly("void");
110118
});
111119
});
112120

test/functional/gracefulTests.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ describe('Test graceful mode', function() {
4848

4949
ast[1][0][0].should.be.exactly('class');
5050
ast[1][0][1].should.be.exactly('foo');
51-
ast[1][0][5].constants.length.should.be.exactly(1);
52-
ast[1][0][5].constants[0][1].should.be.exactly('A');
53-
ast[1][0][5].constants[0][2][1].should.be.exactly('1');
51+
ast[1][0][5].length.should.be.exactly(2); // including the foo error
52+
ast[1][0][5][0][0].should.be.exactly('error');
53+
ast[1][0][5][1][0].should.be.exactly('const');
54+
ast[1][0][5][1][1].should.be.exactly('A');
55+
ast[1][0][5][1][2][1].should.be.exactly('1');
5456

5557
});
5658

0 commit comments

Comments
 (0)