Skip to content

Commit df93600

Browse files
Move script.vue to specs
1 parent 67e6713 commit df93600

File tree

2 files changed

+72
-8
lines changed

2 files changed

+72
-8
lines changed

spec/grammars-spec.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,77 @@ a
493493

494494
});
495495

496+
it("supports language-todo correctly", () => {
497+
498+
let { tokens } = grammar.tokenizeLine(
499+
`\
500+
<script>
501+
// NOTE: this 'NOTE' should be highlighted
502+
// NOTE: this 'NOTE' should be highlighted too </script>
503+
`
504+
);
505+
506+
expect(tokens[0]).toEqual({
507+
value: "<",
508+
scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ]
509+
});
510+
511+
expect(tokens[1]).toEqual({
512+
value: "script",
513+
scopes: [ "text.html.vue", "source.js.embedded.html", "entity.name.tag.script.html" ]
514+
});
515+
516+
expect(tokens[2]).toEqual({
517+
value: ">",
518+
scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ]
519+
});
520+
521+
expect(tokens[3]).toEqual({
522+
value: "\n",
523+
scopes: [ "text.html.vue", "source.js.embedded.html" ]
524+
});
525+
526+
expect(tokens[4]).toEqual({
527+
value: "//",
528+
scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ]
529+
});
530+
531+
expect(tokens[5]).toEqual({
532+
value: " NOTE: this 'NOTE' should be highlighted",
533+
scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ]
534+
});
535+
536+
expect(tokens[6]).toEqual({
537+
value: "\n",
538+
scopes: [ "text.html.vue", "source.js.embedded.html" ]
539+
});
540+
541+
expect(tokens[7]).toEqual({
542+
value: "//",
543+
scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ]
544+
});
545+
546+
expect(tokens[8]).toEqual({
547+
value: " NOTE: this 'NOTE' should be highlighted too ",
548+
scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ]
549+
});
550+
551+
expect(tokens[9]).toEqual({
552+
value: "</",
553+
scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ]
554+
});
555+
556+
expect(tokens[10]).toEqual({
557+
value: "script",
558+
scopes: [ "text.html.vue", "source.js.embedded.html", "entity.name.tag.script.html" ]
559+
});
560+
561+
expect(tokens[11]).toEqual({
562+
value: ">",
563+
scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ]
564+
});
565+
566+
});
567+
496568
});
497569
});

test/script.vue

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)