comment.js 642 B

12345678910111213141516
  1. 'use strict';
  2. var test = require('tape');
  3. var parse = require('../').parse;
  4. test('comment', function (t) {
  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 # "> boop"'), ['beep', { comment: ' "> boop"' }]);
  10. t.same(parse('beep "#"'), ['beep', '#']);
  11. t.same(parse('beep #"#"#'), ['beep', { comment: '"#"#' }]);
  12. t.same(parse('beep > boop # > foo'), ['beep', { op: '>' }, 'boop', { comment: ' > foo' }]);
  13. t.end();
  14. });