aboutsummaryrefslogtreecommitdiff
path: root/test/llvm-ast-parser-tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/llvm-ast-parser-tests.js')
-rw-r--r--test/llvm-ast-parser-tests.js47
1 files changed, 45 insertions, 2 deletions
diff --git a/test/llvm-ast-parser-tests.js b/test/llvm-ast-parser-tests.js
index d51f05b68..07c8f1b8b 100644
--- a/test/llvm-ast-parser-tests.js
+++ b/test/llvm-ast-parser-tests.js
@@ -71,11 +71,11 @@ describe('llvm-ast', function () {
});
it('keeps reasonable-sized output', () => {
- astDumpWithCTime.length.should.be.above(100);
+ astDumpWithCTime.length.should.be.above(200);
let output = mockAstOutput(astDumpWithCTime);
let processed = astParser.processAst(output);
- processed.length.should.be.below(100);
+ processed.length.should.be.below(200);
});
it('links some source lines', () => {
@@ -106,3 +106,46 @@ describe('llvm-ast', function () {
should.exist(processed.find(l => l.text.match(/CXXRecord/)));
});
});
+
+describe('llvm-ast bug-3849a', function () {
+ let compilerProps;
+ let astParser;
+ let astDump;
+ let compilerOutput;
+
+ before(() => {
+ let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
+ compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+
+ astParser = new LlvmAstParser(compilerProps);
+ astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849a.ast').toString());
+ compilerOutput = mockAstOutput(astDump);
+ });
+
+ it('should have more than 2 lines', () => {
+ let processed = astParser.processAst(compilerOutput);
+ processed.length.should.be.above(2);
+ });
+});
+
+describe('llvm-ast bug-3849b', function () {
+ let compilerProps;
+ let astParser;
+ let astDump;
+ let compilerOutput;
+
+ before(() => {
+ let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
+ compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+
+ astParser = new LlvmAstParser(compilerProps);
+ astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849b.ast').toString());
+ compilerOutput = mockAstOutput(astDump);
+ });
+
+ it('should have not too many lines', () => {
+ let processed = astParser.processAst(compilerOutput);
+ processed.length.should.be.above(200);
+ processed.length.should.be.below(300);
+ });
+});