Permalink
Browse files

Add tests for false positives on multi-line comments.

  • Loading branch information...
1 parent 80e3d34 commit 1f488374772d4b73ed83a8bdd4d9d965e5f72911 @JohnAlbin JohnAlbin committed Jul 21, 2014
Showing with 64 additions and 0 deletions.
  1. +47 −0 test/fixtures-styles/options-comment-syntax.less
  2. +17 −0 test/kss.js
@@ -0,0 +1,47 @@
+/*
+Comment syntax: multi-line
+
+Using multi-line comment syntax.
+
+Markup:
+<a href="#" class="{$modifiers}">Hello World</a>
+
+:hover - Highlights when moused over
+:disabled - Dims when unavailable
+.primary - Indicates this is a key element
+
+Styleguide 1.1
+*/
+
+// Comment syntax: inline
+//
+// Using inline comment syntax.
+//
+// Styleguide 1.2
+
+
+.example-1-3 {
+ content: 'This string includes the start of a multi-line comment: /*';
+}
+
+// False-positive of multi-line comment block #1
+//
+// Styleguide 1.3
+
+// This single-line comment includes the end of a multi-line comment: */
+
+
+/* A multi-line comment on a single line. */
+
+// False-positive of multi-line comment block #2
+//
+// Markup:
+// <a href="#" class="{$modifiers}">Hello World</a>
+//
+// :hover - Highlights when moused over
+// :disabled - Dims when unavailable
+// .primary - Indicates this is a key element
+//
+// Styleguide 1.4
+
+// This single-line comment includes the end of a multi-line comment: */
View
@@ -306,6 +306,23 @@ suite('#traverse', function() {
});
});
suite('options', function() {
+ suite('.comment-syntax', function() {
+ common.testSection('Comment syntax: multi-line', 'options-comment-syntax.less', function(section) {
+ assert.equal(section.data.reference, '1.1');
+ }, false, { markup: true });
+
+ common.testSection('Comment syntax: inline', 'options-comment-syntax.less', function(section) {
+ assert.equal(section.data.reference, '1.2');
+ }, false, { markup: true });
+
+ common.testSection('False-positive of multi-line comment block #1', 'options-comment-syntax.less', function(section) {
+ assert.equal(section.data.reference, '1.3');
+ }, false, { markup: true });
+
+ common.testSection('False-positive of multi-line comment block #2', 'options-comment-syntax.less', function(section) {
+ assert.equal(section.data.reference, '1.4');
+ }, false, { markup: true });
+ }),
suite('.markup', function() {
common.testSection('Second paragraph', 'options-markup.less', function(section) {
assert.equal(

0 comments on commit 1f48837

Please sign in to comment.