Skip to content

Commit

Permalink
Merge pull request #720 from Golmote/tests-less
Browse files Browse the repository at this point in the history
Add tests for Less
  • Loading branch information
Golmote committed Sep 1, 2015
2 parents a7b83b6 + 2b0c124 commit cb22f8e
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/languages/less/atrule_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@media {}
@media screen and (min-width: 320px) {}

----------------------------------------------------

[
["atrule", [
"@media"
]],
["punctuation", "{"], ["punctuation", "}"],

["atrule", [
"@media screen and ",
["punctuation", "("],
"min-width",
["punctuation", ":"],
" 320px",
["punctuation", ")"]
]],
["punctuation", "{"], ["punctuation", "}"]
]

----------------------------------------------------

Checks for at-rules.
18 changes: 18 additions & 0 deletions tests/languages/less/comment_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// foobar
/**/
/* foo
bar */

----------------------------------------------------

[
["comment", "//"],
["comment", "// foobar"],
["comment", "/**/"],
["comment", "/* foo\r\nbar */"]
]

----------------------------------------------------

Checks for single-line and multi-line comments.
14 changes: 14 additions & 0 deletions tests/languages/less/operator_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
+ - * /

----------------------------------------------------

[
["operator", "+"],
["operator", "-"],
["operator", "*"],
["operator", "/"]
]

----------------------------------------------------

Checks for operators.
19 changes: 19 additions & 0 deletions tests/languages/less/property_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
font-weight:
@{foobar} :
background-@{foo}:
box-shadow+:
transform+_:

----------------------------------------------------

[
["property", "font-weight"], ["punctuation", ":"],
["property", "@{foobar}"], ["punctuation", ":"],
["property", "background-@{foo}"], ["punctuation", ":"],
["property", "box-shadow+"], ["punctuation", ":"],
["property", "transform+_"], ["punctuation", ":"]
]

----------------------------------------------------

Checks for properties.
24 changes: 24 additions & 0 deletions tests/languages/less/selector_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.bordered {}
.@{foo} {}
.foo (@bg: #fff, @color: #000) {}

----------------------------------------------------

[
["selector", [".bordered"]],
["punctuation", "{"], ["punctuation", "}"],
["selector", [".@{foo}"]],
["punctuation", "{"], ["punctuation", "}"],
["selector", [
".foo (",
["variable", "@bg"],
": #fff, ",
["variable", "@color"],
": #000)"
]],
["punctuation", "{"], ["punctuation", "}"]
]

----------------------------------------------------

Checks for selectors and mixin declarations.

0 comments on commit cb22f8e

Please sign in to comment.