Afanasev_Stepan_PIbd-21_IP/ИП 3 лаба/node_modules/shell-quote/test/comment.js
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00

17 lines
642 B
JavaScript

'use strict';
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();
});