2024-01-16 21:26:16 +08:00
|
|
|
'use strict';
|
|
|
|
|
2023-12-18 13:12:25 +08:00
|
|
|
var test = require('tape');
|
|
|
|
var parse = require('../').parse;
|
|
|
|
|
|
|
|
test('comment', function (t) {
|
2024-01-16 21:26:16 +08:00
|
|
|
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();
|
2023-12-18 13:12:25 +08:00
|
|
|
});
|