comment.js 664 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
var test = require('tape');
var parse = require('../').parse;

test('comment', function (t) {
    t.same(parse('beep#boop'), [ 'beep', { comment: 'boop' } ]);
    t.same(parse('beep #boop'), [ 'beep', { comment: 'boop' } ]);
    t.same(parse('beep # boop'), [ 'beep', { comment: 'boop' } ]);
    t.same(parse('beep # > boop'), [ 'beep', { comment: '> boop' } ]);
    t.same(parse('beep # "> boop"'), [ 'beep', { comment: '"> boop"' } ]);
    t.same(parse('beep "#"'), [ 'beep', '#' ]);
    t.same(parse('beep #"#"#'), [ 'beep', { comment: '"#"#' } ]);
    t.same(parse('beep > boop # > foo'), [ 'beep', {op: '>'}, 'boop', { comment: '> foo' } ]);
    t.end();
});