Skip to content

Commit

Permalink
Update specs to keep trailing comments on the previous line
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Oct 16, 2019
1 parent 0f6a1e4 commit b385e0a
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 5 deletions.
47 changes: 47 additions & 0 deletions spec/basic/06_nesting_and_comments.hrx
Expand Up @@ -65,6 +65,53 @@ div span {
/* yet another comment that should be preserved */
display: inline-block;
}
div span a {
text-decoration: none; /* where will this comment go? */
color: green;
/* what about this comment? */
border: 1px bloo blee red;
}
div empty not_empty {
blah: blah;
bloo: bloo;
}
div p {
padding: 10px 8%;
-webkit-box-sizing: hux;
}
div h1 {
color: "a 'red' and \"blue\" value";
}

/* last comment, top level again --
compare the indentation! */
div {
f: g;
}
div empty span {
a: b;
}
div empty_with_comment {
/* hey now */
}
div empty_with_comment span {
c: d;
}

<===> output-libsass.css
/* top level comment -- should be preserved */
div {
/* another comment that should be preserved */
color: red;
background: blue;
/* the next selector should be indented two spaces */
margin: 10px 5px;
}
div span {
font-weight: bold;
/* yet another comment that should be preserved */
display: inline-block;
}
div span a {
text-decoration: none;
/* where will this comment go? */
Expand Down
4 changes: 4 additions & 0 deletions spec/css/keyframes.hrx
Expand Up @@ -5,6 +5,10 @@ a {
}

<===> bubble/empty/output.css
@keyframes { /**/
}

<===> bubble/empty/output-libsass.css
@keyframes {
/**/
}
17 changes: 17 additions & 0 deletions spec/directives/use/css/order.hrx
Expand Up @@ -451,6 +451,23 @@ a {file: midstream}

<===> import_order/comments_and_imports/output.css
/* upstream comment before import */
@import "upstream.css"; /* midstream comment before use */
/* midstream comment before first import */
@import "midstream1.css";
/* midstream comment before second import */
@import "midstream2.css"; /* input comment before use */
/* input comment before import */
@import "input.css";
/* upstream comment after import */
/* midstream comment after imports */
a {
file: midstream;
}

/* input comment after import */

<===> import_order/comments_and_imports/output-libsass.css
/* upstream comment before import */

@import "upstream.css";

Expand Down
9 changes: 9 additions & 0 deletions spec/libsass-closed-issues/issue_1007.hrx
Expand Up @@ -4,6 +4,15 @@
} /* end */
<===> output.css
/* start */
foo baz {
/* before */
margin: 0; /* after */
}

/* end */

<===> output-libsass.css
/* start */
foo baz {
/* before */
margin: 0;
Expand Down
8 changes: 8 additions & 0 deletions spec/libsass-closed-issues/issue_1294.hrx
Expand Up @@ -11,6 +11,14 @@ foo {
/*------------------------------------*\
#BUTTONS
\*------------------------------------*/
foo {
display: inline-block; /* [1] */
}

<===> output-libsass.css
/*------------------------------------*\
#BUTTONS
\*------------------------------------*/
foo {
display: inline-block;
/* [1] */
Expand Down
8 changes: 8 additions & 0 deletions spec/libsass-closed-issues/issue_1567.hrx
Expand Up @@ -7,6 +7,14 @@

<===> output.css
/* any */
@media screen, not print { /* whatever */
body {
line-height: 1.2;
}
}

<===> output-libsass.css
/* any */
@media screen, not print {
/* whatever */
body {
Expand Down
9 changes: 4 additions & 5 deletions spec/libsass-closed-issues/issue_894.hrx
Expand Up @@ -2,19 +2,18 @@
a {/**/}
b {content: 'something so I have a non-empty expected output'}
<===> output.css
a {
/**/
a { /**/
}

b {
content: 'something so I have a non-empty expected output';
content: "something so I have a non-empty expected output";
}

<===> output-dart-sass.css
<===> output-libsass.css
a {
/**/
}

b {
content: "something so I have a non-empty expected output";
content: 'something so I have a non-empty expected output';
}
6 changes: 6 additions & 0 deletions spec/libsass-closed-issues/issue_941.hrx
Expand Up @@ -6,6 +6,12 @@

<===> output.css
.one,
.two { /* 3 */
color: #F00; /* 4 */
}

<===> output-libsass.css
.one,
.two {
/* 3 */
color: #F00;
Expand Down

0 comments on commit b385e0a

Please sign in to comment.