diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb0df2..c9792f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ### Added +- Add basic cassius test cases (selector group, class selector, id selector, combinators) [#42](https://github.com/e-bigmoon/vscode-language-yesod/pull/42) @isao-takejib - Add Haskell Syntax Highlighting as a dependency [#54](https://github.com/e-bigmoon/vscode-language-yesod/pull/54) @isao-takejib ## [0.9.0] - 2021-10-02 diff --git a/package.json b/package.json index 8eebb84..7d2aaa8 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,10 @@ "url": "https://github.com/e-bigmoon/vscode-language-yesod/issues" }, "scripts": { - "test": "npm run test-hamlet && npm run test-lucius && npm run test-yesodroutes", + "test": "npm run test-hamlet && npm run test-lucius && npm run test-cassius && npm run test-yesodroutes", "test-hamlet": "npx vscode-tmgrammar-test -s source.yesod.hamlet -g test/resources/haskell.tmLanguage.json -g syntaxes/hamlet.tmLanguage.json -t 'test/tests/hamlet/*.hamlet'", "test-lucius": "npx vscode-tmgrammar-test -s source.yesod.lucius -g test/resources/haskell.tmLanguage.json -g syntaxes/lucius.tmLanguage.json -t 'test/tests/lucius/*.lucius'", + "test-cassius": "npx vscode-tmgrammar-test -s source.yesod.cassius -g test/resources/haskell.tmLanguage.json -g syntaxes/cassius.tmLanguage.json -t 'test/tests/cassius/*.cassius'", "test-yesodroutes": "npx vscode-tmgrammar-test -s source.yesod.routes -g test/resources/haskell.tmLanguage.json -g syntaxes/routes.tmLanguage.json -t 'test/tests/routes/*.yesodroutes'" }, "engines": { diff --git a/test/tests/cassius/class-selector.cassius b/test/tests/cassius/class-selector.cassius new file mode 100644 index 0000000..201d2ab --- /dev/null +++ b/test/tests/cassius/class-selector.cassius @@ -0,0 +1,39 @@ +// SYNTAX TEST "source.yesod.cassius" "class selector" + +*.pastoral +// <- meta.selector.css entity.name.tag.wildcard.css +// <~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +.pastoral +// <- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~-------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css +} + +H1.pastoral +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~-------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +p.pastoral.marine +// <- meta.selector.css entity.name.tag.css +// <~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~-------- meta.selector.css entity.other.attribute-name.class.css +// <~~~~~~~~~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~~~~~~~~~------ meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css diff --git a/test/tests/cassius/combinator.cassius b/test/tests/cassius/combinator.cassius new file mode 100644 index 0000000..1c5510d --- /dev/null +++ b/test/tests/cassius/combinator.cassius @@ -0,0 +1,80 @@ +// SYNTAX TEST "source.yesod.cassius" "combinators" + +h1 em +// <-- meta.selector.css entity.name.tag.css +// <~~~-- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div * p +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css entity.name.tag.wildcard.css +// <~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div p *[href] +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css entity.name.tag.wildcard.css +// <~~~~~~~- meta.selector.css meta.attribute-selector.css punctuation.definition.entity.begin.bracket.square.css +// <~~~~~~~~~~~~ meta.selector.css meta.attribute-selector.css entity.other.attribute-name.css +// <~~~~~~~~~~~~- meta.selector.css meta.attribute-selector.css punctuation.definition.entity.end.bracket.square.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +body > p +// <---- meta.selector.css entity.name.tag.css +// <~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div ol>li p +// <--- meta.selector.css entity.name.tag.css +// <~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +math + p +// <---- meta.selector.css entity.name.tag.css +// <~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~- meta.selector.css entity.name.tag.css + text-indent: 0 +// ^^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^ meta.property-list.css meta.property-value.css constant.numeric.css + +h1.opener + h2 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~------ meta.selector.css entity.other.attribute-name.class.css +// <~~~~~~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~~~~~~-- meta.selector.css entity.name.tag.css + margin-top: -5mm +// ^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^ meta.property-list.css meta.property-value.css constant.numeric.css +// ^^ meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.mm.css + +img ~ p +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css diff --git a/test/tests/cassius/id-selector.cassius b/test/tests/cassius/id-selector.cassius new file mode 100644 index 0000000..1e1e20a --- /dev/null +++ b/test/tests/cassius/id-selector.cassius @@ -0,0 +1,27 @@ +// SYNTAX TEST "source.yesod.cassius" "id selector" + +h1#chapter1 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~~~-------- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +#chapter1 +// <- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~-------- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +*#z98y +// <- meta.selector.css entity.name.tag.wildcard.css +// <~- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~~---- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css diff --git a/test/tests/cassius/selector-groups.cassius b/test/tests/cassius/selector-groups.cassius new file mode 100644 index 0000000..752187e --- /dev/null +++ b/test/tests/cassius/selector-groups.cassius @@ -0,0 +1,12 @@ +// SYNTAX TEST "source.yesod.cassius" "groups of selectors" + +h1, h2, h3 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css punctuation.separator.list.comma.css +// <~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css punctuation.separator.list.comma.css +// <~~~~~~~~-- meta.selector.css entity.name.tag.css + font-family: sans-serif +// ^^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^^^^^^ meta.property-list.css meta.property-value.css support.constant.font-name.css