Commit 6206d31cfc1d3cf38b086e914f8921c8d30fcc88

Golmote 2015-09-06T12:17:01

Merge pull request #744 from Golmote/tests-scss Add tests for Scss

diff --git a/tests/languages/scss/atrule_feature.test b/tests/languages/scss/atrule_feature.test
new file mode 100644
index 0000000..bb1abf8
--- /dev/null
+++ b/tests/languages/scss/atrule_feature.test
@@ -0,0 +1,20 @@
+@media (min-width: 600px) {}
+
+----------------------------------------------------
+
+[
+	["atrule", [
+		["rule", "@media"],
+		["punctuation", "("],
+		["property", "min-width"],
+		["punctuation", ":"],
+		" 600px",
+		["punctuation", ")"]
+	]],
+	["punctuation", "{"],
+    ["punctuation", "}"]
+]
+
+----------------------------------------------------
+
+Checks for at-rules.
\ No newline at end of file
diff --git a/tests/languages/scss/boolean_feature.test b/tests/languages/scss/boolean_feature.test
new file mode 100644
index 0000000..4019c44
--- /dev/null
+++ b/tests/languages/scss/boolean_feature.test
@@ -0,0 +1,13 @@
+true
+false
+
+----------------------------------------------------
+
+[
+	["boolean", "true"],
+	["boolean", "false"]
+]
+
+----------------------------------------------------
+
+Checks for booleans.
\ No newline at end of file
diff --git a/tests/languages/scss/comment_feature.test b/tests/languages/scss/comment_feature.test
new file mode 100644
index 0000000..90eb0bf
--- /dev/null
+++ b/tests/languages/scss/comment_feature.test
@@ -0,0 +1,19 @@
+//
+// foobar
+/**/
+/* foo
+bar */
+
+
+----------------------------------------------------
+
+[
+	["comment", "//"],
+	["comment", "// foobar"],
+	["comment", "/**/"],
+	["comment", "/* foo\r\nbar */"]
+]
+
+----------------------------------------------------
+
+Checks for comments.
\ No newline at end of file
diff --git a/tests/languages/scss/keyword_feature.test b/tests/languages/scss/keyword_feature.test
new file mode 100644
index 0000000..90ca11d
--- /dev/null
+++ b/tests/languages/scss/keyword_feature.test
@@ -0,0 +1,28 @@
+@if @else if @else
+@for @each @while
+@import @extend
+@debug @warn @mixin
+@include @function
+@return @content
+
+@for $i from 1 through 3
+
+----------------------------------------------------
+
+[
+	["keyword", "@if"], ["keyword", "@else if"], ["keyword", "@else"],
+	["keyword", "@for"], ["keyword", "@each"], ["keyword", "@while"],
+	["keyword", "@import"], ["keyword", "@extend"],
+	["keyword", "@debug"], ["keyword", "@warn"], ["keyword", "@mixin"],
+	["keyword", "@include"], ["keyword", "@function"],
+	["keyword", "@return"], ["keyword", "@content"],
+
+	["keyword", "@for"],
+	["variable", "$i"],
+	["keyword", "from"],
+	" 1 ",
+	["keyword", "through"],
+	" 3"
+]
+
+----------------------------------------------------
diff --git a/tests/languages/scss/null_feature.test b/tests/languages/scss/null_feature.test
new file mode 100644
index 0000000..1283944
--- /dev/null
+++ b/tests/languages/scss/null_feature.test
@@ -0,0 +1,11 @@
+null
+
+----------------------------------------------------
+
+[
+	["null", "null"]
+]
+
+----------------------------------------------------
+
+Checks for null.
\ No newline at end of file
diff --git a/tests/languages/scss/operator_feature.test b/tests/languages/scss/operator_feature.test
new file mode 100644
index 0000000..54f9713
--- /dev/null
+++ b/tests/languages/scss/operator_feature.test
@@ -0,0 +1,38 @@
+4 - 2;
+4 + 2;
+4 * 2;
+4 / 2;
+4 % 2;
+4 == 2;
+4 != 2;
+4 < 2;
+4 <= 2;
+4 > 2;
+4 >= 2;
+true and false
+false or true
+not true
+
+----------------------------------------------------
+
+[
+	"4 ", ["operator", "-"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "+"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "*"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "/"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "%"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "=="], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "!="], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "<"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", "<="], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", ">"], " 2", ["punctuation", ";"],
+	"\r\n4 ", ["operator", ">="], " 2", ["punctuation", ";"],
+
+	["boolean", "true"], ["operator", "and"], ["boolean", "false"],
+	["boolean", "false"], ["operator", "or"], ["boolean", "true"],
+	["operator", "not"], ["boolean", "true"]
+]
+
+----------------------------------------------------
+
+Checks for operators.
\ No newline at end of file
diff --git a/tests/languages/scss/placeholder_feature.test b/tests/languages/scss/placeholder_feature.test
new file mode 100644
index 0000000..bc59d86
--- /dev/null
+++ b/tests/languages/scss/placeholder_feature.test
@@ -0,0 +1,15 @@
+%foobar
+%foo-bar
+%foo_bar
+
+----------------------------------------------------
+
+[
+	["placeholder", "%foobar"],
+	["placeholder", "%foo-bar"],
+	["placeholder", "%foo_bar"]
+]
+
+----------------------------------------------------
+
+Checks for placeholders.
\ No newline at end of file
diff --git a/tests/languages/scss/selector_feature.test b/tests/languages/scss/selector_feature.test
new file mode 100644
index 0000000..3749f22
--- /dev/null
+++ b/tests/languages/scss/selector_feature.test
@@ -0,0 +1,23 @@
+a {}
+p, div {}
+#foobar .foo {}
+&:hover {}
+&-sidebar {}
+#context a%extreme {}
+#{$selector}:before {}
+
+----------------------------------------------------
+
+[
+	["selector", ["a "]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["p, div "]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["#foobar .foo "]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["&:hover "]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["&-sidebar "]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["#context a", ["placeholder", "%extreme"]]], ["punctuation", "{"], ["punctuation", "}"],
+	["selector", ["#{$selector}:before "]], ["punctuation", "{"], ["punctuation", "}"]
+]
+
+----------------------------------------------------
+
+Checks for selectors.
\ No newline at end of file
diff --git a/tests/languages/scss/statement_feature.test b/tests/languages/scss/statement_feature.test
new file mode 100644
index 0000000..7a85f9c
--- /dev/null
+++ b/tests/languages/scss/statement_feature.test
@@ -0,0 +1,21 @@
+$foo: "bar" !default;
+@extend .baz !optional;
+
+----------------------------------------------------
+
+[
+	["variable", "$foo"],
+	["punctuation", ":"],
+	["string", "\"bar\""],
+	["statement", "!default"],
+	["punctuation", ";"],
+
+	["keyword", "@extend"],
+	" .baz ",
+	["statement", "!optional"],
+	["punctuation", ";"]
+]
+
+----------------------------------------------------
+
+Checks for statements.
\ No newline at end of file
diff --git a/tests/languages/scss/url_feature.test b/tests/languages/scss/url_feature.test
new file mode 100644
index 0000000..42e3870
--- /dev/null
+++ b/tests/languages/scss/url_feature.test
@@ -0,0 +1,19 @@
+url('foo.png')
+font-url('foo.ttf')
+
+----------------------------------------------------
+
+[
+	["url", "url"],
+	["punctuation", "("],
+	["string", "'foo.png'"],
+	["punctuation", ")"],
+	["url", "font-url"],
+	["punctuation", "("],
+	["string", "'foo.ttf'"],
+	["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Checks for URLs.
\ No newline at end of file
diff --git a/tests/languages/scss/variable_feature.test b/tests/languages/scss/variable_feature.test
new file mode 100644
index 0000000..6e2c512
--- /dev/null
+++ b/tests/languages/scss/variable_feature.test
@@ -0,0 +1,21 @@
+$foo
+$foo-bar
+$foo_bar
+#{$foo}
+#{$foo-bar}
+#{$foo_bar}
+
+----------------------------------------------------
+
+[
+	["variable", "$foo"],
+	["variable", "$foo-bar"],
+	["variable", "$foo_bar"],
+	["variable", "#{$foo}"],
+	["variable", "#{$foo-bar}"],
+	["variable", "#{$foo_bar}"]
+]
+
+----------------------------------------------------
+
+Checks for variables.
\ No newline at end of file