Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic cassius test cases #42

Merged
merged 7 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
39 changes: 39 additions & 0 deletions test/tests/cassius/class-selector.cassius
Original file line number Diff line number Diff line change
@@ -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
80 changes: 80 additions & 0 deletions test/tests/cassius/combinator.cassius
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions test/tests/cassius/id-selector.cassius
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions test/tests/cassius/selector-groups.cassius
Original file line number Diff line number Diff line change
@@ -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