feat(compiler): support for singleline, multiline & jsdoc comments (#22715)

PR Close #22715
This commit is contained in:
Olivier Combe
2018-03-12 15:34:03 +01:00
committed by Miško Hevery
parent 02e6ac2117
commit 3b167be069
8 changed files with 215 additions and 31 deletions

View File

@ -21,5 +21,22 @@ import * as o from '../../src/output/output_ast';
expect(o.collectExternalReferences([stmt])).toEqual([ref1, ref2]);
});
});
describe('comments', () => {
it('different JSDocCommentStmt should not be equivalent', () => {
const comment1 = new o.JSDocCommentStmt([{text: 'text'}]);
const comment2 = new o.JSDocCommentStmt([{text: 'text2'}]);
const comment3 = new o.JSDocCommentStmt([{tagName: o.JSDocTagName.Desc, text: 'text2'}]);
const comment4 = new o.JSDocCommentStmt([{text: 'text2'}, {text: 'text3'}]);
expect(comment1.isEquivalent(comment2)).toBeFalsy();
expect(comment1.isEquivalent(comment3)).toBeFalsy();
expect(comment1.isEquivalent(comment4)).toBeFalsy();
expect(comment2.isEquivalent(comment3)).toBeFalsy();
expect(comment2.isEquivalent(comment4)).toBeFalsy();
expect(comment3.isEquivalent(comment4)).toBeFalsy();
expect(comment1.isEquivalent(comment1)).toBeTruthy();
});
});
});
}