comment.js 664 B

1234567891011121314
  1. var test = require('tape');
  2. var parse = require('../').parse;
  3. test('comment', function (t) {
  4. t.same(parse('beep#boop'), [ 'beep', { comment: 'boop' } ]);
  5. t.same(parse('beep #boop'), [ 'beep', { comment: 'boop' } ]);
  6. t.same(parse('beep # boop'), [ 'beep', { comment: 'boop' } ]);
  7. t.same(parse('beep # > boop'), [ 'beep', { comment: '> boop' } ]);
  8. t.same(parse('beep # "> boop"'), [ 'beep', { comment: '"> boop"' } ]);
  9. t.same(parse('beep "#"'), [ 'beep', '#' ]);
  10. t.same(parse('beep #"#"#'), [ 'beep', { comment: '"#"#' } ]);
  11. t.same(parse('beep > boop # > foo'), [ 'beep', {op: '>'}, 'boop', { comment: '> foo' } ]);
  12. t.end();
  13. });