Skip to content

Commit

Permalink
Merge pull request #1360 from sass/cr-lf-comment
Browse files Browse the repository at this point in the history
Add specs for CR, CR LF, and FF line endings
  • Loading branch information
nex3 authored Mar 18, 2019
2 parents 146b775 + fe356ae commit 150cdc5
Show file tree
Hide file tree
Showing 9 changed files with 239 additions and 124 deletions.
30 changes: 0 additions & 30 deletions spec/css/bizarrely_formatted_comments.hrx

This file was deleted.

9 changes: 0 additions & 9 deletions spec/css/closing_line_comment_end_with_compact_output.hrx

This file was deleted.

133 changes: 133 additions & 0 deletions spec/css/comment.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<===> multiple/input.scss
.foo {
/* Foo Bar */
/* Baz Bang */ }

<===> multiple/output.css
.foo {
/* Foo Bar */
/* Baz Bang */
}

<===>
================================================================================
<===> multiple_stars/input.scss
a /***/ b {x: y}
a /****/ b {x: y}
a /* **/ b {x: y}
a /** */ b {x: y}

<===> multiple_stars/output.css
a b {
x: y;
}
a b {
x: y;
}
a b {
x: y;
}
a b {
x: y;
}

<===>
================================================================================
<===> weird_indentation/input.scss
.foo {
/* Foo
Bar
Baz */
a: b; }

<===> weird_indentation/output.css
.foo {
/* Foo
Bar
Baz */
a: b;
}

<===> weird_indentation/output-libsass.css
.foo {
/* Foo
Bar
Baz */
a: b;
}

<===> weird_indentation/output-ruby-sass.css
.foo {
/* Foo
Bar
Baz */
a: b;
}

<===>
================================================================================
<===> converts_newlines/README.md
Everything CSS considers a newline (including `\r\n`, `\r`, and `\f`) should be
converted to a newline in a comment's contents.

Note that we don't test CR LF because the spec runner normalizes those itself,
so we can't usefully verify that they're converted. Individual implementations
should include their own tests for CR LF newlines.

<===>
================================================================================
<===> converts_newlines/scss/cr/options.yml
---
:todo:
- libsass # sass/libsass#2843

<===> converts_newlines/scss/cr/input.scss
/* foo * bar */

<===> converts_newlines/scss/cr/output.css
/* foo
* bar */

<===>
================================================================================
<===> converts_newlines/scss/ff/options.yml
---
:todo:
- libsass # sass/libsass#2843

<===> converts_newlines/scss/ff/input.scss
/* foo * bar */

<===> converts_newlines/scss/ff/output.css
/* foo
* bar */

<===>
================================================================================
<===> converts_newlines/sass/cr/input.sass
/*
foo bar

<===> converts_newlines/sass/cr/output.css
/* foo
* bar */

<===> converts_newlines/sass/cr/output-libsass.css
/*
foo
bar */

<===>
================================================================================
<===> converts_newlines/sass/ff/options.yml
---
:todo:
- libsass # sass/libsass#2843

<===> converts_newlines/sass/ff/input.sass
/*
foo bar

<===> converts_newlines/sass/ff/output.css
/* foo
* bar */
Expand Down
19 changes: 0 additions & 19 deletions spec/css/multi_star_comments.hrx

This file was deleted.

10 changes: 0 additions & 10 deletions spec/css/multiple_comments.hrx

This file was deleted.

17 changes: 0 additions & 17 deletions spec/sass/different_indentation/spaces.hrx

This file was deleted.

17 changes: 0 additions & 17 deletions spec/sass/different_indentation/tabs.hrx

This file was deleted.

22 changes: 0 additions & 22 deletions spec/sass/inconsistent_indentation.hrx

This file was deleted.

106 changes: 106 additions & 0 deletions spec/sass/indentation.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<===> different/spaces/input.sass
a
b: c
d: e

x
y: z

<===> different/spaces/output.css
a {
b: c;
b-d: e;
}

x {
y: z;
}

<===>
================================================================================
<===> different/tabs/input.sass
a
b: c
d: e

x
y: z

<===> different/tabs/output.css
a {
b: c;
b-d: e;
}

x {
y: z;
}

<===>
================================================================================
<===> unusual_newlines/README.md
Everything CSS considers a newline (including `\r\n`, `\r`, and `\f`) should be
usable as the end of an indented syntax line.

<===>
================================================================================
<===> unusual_newlines/cr_lf/input.sass
a
b: c
d: e

<===> unusual_newlines/cr_lf/output.css
a {
b: c;
d: e;
}

<===>
================================================================================
<===> unusual_newlines/cr/input.sass
a b: c d: e
<===> unusual_newlines/cr/output.css
a {
b: c;
d: e;
}

<===>
================================================================================
<===> unusual_newlines/ff/options.yml
---
:todo:
- libsass # sass/libsass#2843

<===> unusual_newlines/ff/input.sass
a b: c d: e
<===> unusual_newlines/ff/output.css
a {
b: c;
d: e;
}

<===>
================================================================================
<===> error/inconsistent/options.yml
---
:todo:
- libsass

<===> error/inconsistent/input.sass
a
b: c
d: e

<===> error/inconsistent/error
Error: Inconsistent indentation: 1 space was used for indentation, but the rest of the document was indented using 4 spaces.
on line 3 of /sass/spec/sass/inconsistent_indentation/input.sass
Use --trace for backtrace.

<===> error/inconsistent/error-dart-sass
Error: Inconsistent indentation, expected 4 spaces.
,
3 | d: e
| ^
'
/sass/spec/sass/indentation/error/inconsistent/input.sass 3:1 root stylesheet
Expand Down

0 comments on commit 150cdc5

Please sign in to comment.