Skip to content

Commit

Permalink
Add a spec for interpolation after a hyphen (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Apr 13, 2018
1 parent e6166e4 commit d9259a1
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.test {
background-position: 0-1.12em;
background-position: 0 -1.12em;
}
2 changes: 2 additions & 0 deletions spec/libsass-closed-issues/issue_1722-4.0/options.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
:start_version: '4.0'
:ignore_for:
- ruby-sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ foo {
test-6: 10 -10px;
test-7: 0px;
test-8: 0px;
test-9: 10-10px;
test-10: 10-10px;
test-9: 10 -10px;
test-10: 10 -10px;
test-11: 10-10px;
test-12: 10-10px;
test-13: 9 0px;
Expand All @@ -28,7 +28,7 @@ foo {
test-27: 10px- 10px;
test-28: 0px;
test-29: 10px- 10px;
test-30: 10px-10px;
test-30: 10px -10px;
test-31: 10px- 10px;
test-32: 10px-10px;
test-33: 9px 0px;
Expand All @@ -44,7 +44,7 @@ foo {
test-43: 10px- 10 px;
test-44: 0px px;
test-45: 10px-10px;
test-46: 10px-10px;
test-46: 10px -10px;
test-47: 10px- 10px;
test-48: 10px-10px;
test-49: 10px-10px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
:start_version: '4.0'
:ignore_for:
- ruby-sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@ foo {
test-2: 10 -10;
test-3: 0;
test-4: 0;
test-5: 10-10;
test-6: 10-10;
test-5: 10 -10;
test-6: 10 -10;
test-7: 10-10;
test-8: 10-10;
test-9: 9 0;
test-10: 10 -1 0;
test-11: 9 0;
test-12: 9 0;
test-13: 10-10;
test-14: 10-10;
test-13: 10 -10;
test-14: 10 -10;
test-15: 10-10;
test-16: 10-10;
test-17: 10-10;
test-18: 10-10;
test-18: 10 -10;
test-19: 10- 10;
test-20: 10-10;
test-21: 10-10;
test-22: 10 -1 0;
test-23: 10- 1 0;
test-24: 10-1 0;
test-25: 10-10;
test-26: 10-10;
test-26: 10 -10;
test-27: 10- 10;
test-28: 10-10;
test-29: 1 0-10;
test-30: 1 0 -1 0;
test-31: 1 0- 1 0;
test-32: 1 0-1 0;
test-33: 1 0-10;
test-34: 1 0-10;
test-34: 1 0 -10;
test-35: 1 0- 10;
test-36: 1 0-10;
test-37: 10-10;
test-38: 10-10;
test-38: 10 -10;
test-39: 10- 10;
test-40: 10-10;
}
2 changes: 2 additions & 0 deletions spec/parser/operations/subtract/numbers/pairs-4.0/options.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
:start_version: '4.0'
:ignore_for:
- ruby-sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,55 @@ foo {
test-7: literal- "quoted";
test-8: literal-"quoted";
test-9: literal-interpolant;
test-10: literal-interpolant;
test-10: literal -interpolant;
test-11: literal- interpolant;
test-12: literal-interpolant;
test-13: literal-lschema_ritlp;
test-14: literal -lschema_ritlp;
test-15: literal- lschema_ritlp;
test-16: literal-lschema_ritlp;
test-17: literal-litlp_rschema;
test-18: literal-litlp_rschema;
test-18: literal -litlp_rschema;
test-19: literal- litlp_rschema;
test-20: literal-litlp_rschema;
test-21: "quoted"-"quoted";
test-22: "quoted"-"quoted";
test-23: "quoted"-"quoted";
test-24: "quoted"-"quoted";
test-25: "quoted"-interpolant;
test-26: "quoted"-interpolant;
test-25: "quoted" -interpolant;
test-26: "quoted" -interpolant;
test-27: "quoted"-interpolant;
test-28: "quoted"-interpolant;
test-29: "quoted" -lschema_ritlp;
test-30: "quoted" -lschema_ritlp;
test-31: "quoted"-lschema_ritlp;
test-32: "quoted"-lschema_ritlp;
test-33: "quoted"-litlp_rschema;
test-34: "quoted"-litlp_rschema;
test-33: "quoted" -litlp_rschema;
test-34: "quoted" -litlp_rschema;
test-35: "quoted"-litlp_rschema;
test-36: "quoted"-litlp_rschema;
test-37: interpolant-interpolant;
test-38: interpolant-interpolant;
test-38: interpolant -interpolant;
test-39: interpolant- interpolant;
test-40: interpolant-interpolant;
test-41: interpolant-lschema_ritlp;
test-42: interpolant -lschema_ritlp;
test-43: interpolant- lschema_ritlp;
test-44: interpolant-lschema_ritlp;
test-45: interpolant-litlp_rschema;
test-46: interpolant-litlp_rschema;
test-46: interpolant -litlp_rschema;
test-47: interpolant- litlp_rschema;
test-48: interpolant-litlp_rschema;
test-49: lschema_ritlp-lschema_ritlp;
test-50: lschema_ritlp -lschema_ritlp;
test-51: lschema_ritlp- lschema_ritlp;
test-52: lschema_ritlp-lschema_ritlp;
test-53: lschema_ritlp-litlp_rschema;
test-54: lschema_ritlp-litlp_rschema;
test-54: lschema_ritlp -litlp_rschema;
test-55: lschema_ritlp- litlp_rschema;
test-56: lschema_ritlp-litlp_rschema;
test-57: litlp_rschema-litlp_rschema;
test-58: litlp_rschema-litlp_rschema;
test-58: litlp_rschema -litlp_rschema;
test-59: litlp_rschema- litlp_rschema;
test-60: litlp_rschema-litlp_rschema;
}
2 changes: 2 additions & 0 deletions spec/parser/operations/subtract/strings/pairs-4.0/options.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
:start_version: '4.0'
:ignore_for:
- ruby-sass
7 changes: 7 additions & 0 deletions spec/sass_4_0/interpolation/after_hyphen/expected_output.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.after-hyphen {
standalone-single: -foo;
standalone-double: --foo;

adjacent-single: foo -bar;
adjacent-double: foo --bar;
}
12 changes: 12 additions & 0 deletions spec/sass_4_0/interpolation/after_hyphen/input.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.after-hyphen {
// We want to treat interpolation as though it's a valid identifier character,
// which means that if it comes after a hyphen or double-hyphen it should be
// treated as part of an interpolated identifier that includes that hyphen.
standalone-single: -#{foo};
standalone-double: --#{foo};

// It also means that we shouldn't treat the hyphen as a subtraction
// operation.
adjacent-single: #{foo} -#{bar};
adjacent-double: #{foo} --#{bar};
}
3 changes: 3 additions & 0 deletions spec/sass_4_0/interpolation/after_hyphen/options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
:ignore_for:
- ruby-sass
8 changes: 4 additions & 4 deletions spec/scss/zero-compression-4.0/expected_output.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
foo {
tst-1: 0-0.12em;
tst-2: 0-0.12em;
tst-3: 0-0.12em;
tst-4: 0-0.12em;
tst-1: 0 -0.12em;
tst-2: 0 -0.12em;
tst-3: 0 -0.12em;
tst-4: 0 -0.12em;
}
2 changes: 2 additions & 0 deletions spec/scss/zero-compression-4.0/options.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
:start_version: '4.0'
:ignore_for:
- ruby-sass

0 comments on commit d9259a1

Please sign in to comment.