escapes.js 844 B

12345678910111213141516171819
  1. "use strict";
  2. var _helpers = require("./util/helpers");
  3. (0, _helpers.test)('escaped semicolon in class', '.\\;', function (t, tree) {
  4. t.deepEqual(tree.nodes[0].nodes[0].value, ';');
  5. t.deepEqual(tree.nodes[0].nodes[0].raws.value, '\\;');
  6. t.deepEqual(tree.nodes[0].nodes[0].type, 'class');
  7. });
  8. (0, _helpers.test)('escaped semicolon in id', '#\\;', function (t, tree) {
  9. t.deepEqual(tree.nodes[0].nodes[0].value, ';');
  10. t.deepEqual(tree.nodes[0].nodes[0].raws.value, '\\;');
  11. t.deepEqual(tree.nodes[0].nodes[0].type, 'id');
  12. }); // This is a side-effect of allowing media queries to be parsed. Not sure it shouldn't just be an error.
  13. (0, _helpers.test)('bare parens capture contents as a string', '(h1)', function (t, tree) {
  14. t.deepEqual(tree.nodes[0].nodes[0].value, '(h1)');
  15. t.deepEqual(tree.nodes[0].nodes[0].type, 'string');
  16. });