-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from mgreter/feature/variable-scoping
Add variable scope tests (globals and defaults)
- Loading branch information
Showing
66 changed files
with
523 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
div { asd: 9; qwe: 99; zapf: 3; ding: 84; } | ||
|
||
div { foo: 42; foo: 99; foo: 999; foo: 999; baz: 9999; } | ||
div div { bar: 9999; bar: 999; } | ||
|
||
div { asd: 99; qwe: 42; zap: 3; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
div{asd:9;qwe:99;zapf:3;ding:84}div{foo:42;foo:99;foo:999;foo:999;baz:9999}div div{bar:9999;bar:999}div{asd:99;qwe:42;zap:3} |
24 changes: 24 additions & 0 deletions
24
spec/libsass/variable-scoping/defaults/expected.expanded.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
div { | ||
asd: 9; | ||
qwe: 99; | ||
zapf: 3; | ||
ding: 84; | ||
} | ||
|
||
div { | ||
foo: 42; | ||
foo: 99; | ||
foo: 999; | ||
foo: 999; | ||
baz: 9999; | ||
} | ||
div div { | ||
bar: 9999; | ||
bar: 999; | ||
} | ||
|
||
div { | ||
asd: 99; | ||
qwe: 42; | ||
zap: 3; | ||
} |
20 changes: 20 additions & 0 deletions
20
spec/libsass/variable-scoping/defaults/expected_output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
div { | ||
asd: 9; | ||
qwe: 99; | ||
zapf: 3; | ||
ding: 84; } | ||
|
||
div { | ||
foo: 42; | ||
foo: 99; | ||
foo: 999; | ||
foo: 999; | ||
baz: 9999; } | ||
div div { | ||
bar: 9999; | ||
bar: 999; } | ||
|
||
div { | ||
asd: 99; | ||
qwe: 42; | ||
zap: 3; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
$i: 9; | ||
$z: 3 !default; | ||
div { | ||
asd: $i; | ||
$i: 99 !global; | ||
$n: 42 !global; | ||
qwe: $i; | ||
zapf: $z; | ||
$z: 84; | ||
ding: $z; | ||
} | ||
div { | ||
foo: $n; | ||
foo: $i; | ||
$i: 999; | ||
$n: 999; | ||
foo: $n; | ||
foo: $i; | ||
div { | ||
$i: 9999; | ||
$n: 9999 !default; | ||
bar: $i; | ||
bar: $n; | ||
} | ||
baz: $i; | ||
} | ||
div { | ||
asd: $i; | ||
qwe: $n; | ||
zap: $z; | ||
} |
2 changes: 2 additions & 0 deletions
2
spec/libsass/variable-scoping/lexical-scope/expected.compact.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
div { x: 42; y: 109; } | ||
div for { y: 89; x: 1; x: 999; y: 94; x: 2; x: 999; y: 99; x: 3; x: 999; y: 104; x: 4; x: 999; y: 109; x: 5; x: 999; } |
1 change: 1 addition & 0 deletions
1
spec/libsass/variable-scoping/lexical-scope/expected.compressed.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
div{x:42;y:109}div for{y:89;x:1;x:999;y:94;x:2;x:999;y:99;x:3;x:999;y:104;x:4;x:999;y:109;x:5;x:999} |
21 changes: 21 additions & 0 deletions
21
spec/libsass/variable-scoping/lexical-scope/expected.expanded.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
div { | ||
x: 42; | ||
y: 109; | ||
} | ||
div for { | ||
y: 89; | ||
x: 1; | ||
x: 999; | ||
y: 94; | ||
x: 2; | ||
x: 999; | ||
y: 99; | ||
x: 3; | ||
x: 999; | ||
y: 104; | ||
x: 4; | ||
x: 999; | ||
y: 109; | ||
x: 5; | ||
x: 999; | ||
} |
19 changes: 19 additions & 0 deletions
19
spec/libsass/variable-scoping/lexical-scope/expected_output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
div { | ||
x: 42; | ||
y: 109; } | ||
div for { | ||
y: 89; | ||
x: 1; | ||
x: 999; | ||
y: 94; | ||
x: 2; | ||
x: 999; | ||
y: 99; | ||
x: 3; | ||
x: 999; | ||
y: 104; | ||
x: 4; | ||
x: 999; | ||
y: 109; | ||
x: 5; | ||
x: 999; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
$x: -42; | ||
$y: -84; | ||
div { | ||
$x: 42; | ||
$y: 84; | ||
for { | ||
@for $x from 1 through 5 { | ||
$y: $y + 5; | ||
y: $y; | ||
x: $x; | ||
$x: 999; | ||
x: $x; | ||
$y: -9 !global; | ||
$x: -9 !global; | ||
} | ||
} | ||
x: $x; | ||
y: $y; | ||
} |
2 changes: 2 additions & 0 deletions
2
spec/libsass/variable-scoping/root-scope/expected.compact.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
div { x: -9; y: -9; } | ||
div for { y: -79; x: 1; x: 999; y: -74; x: 2; x: 999; y: -69; x: 3; x: 999; y: -64; x: 4; x: 999; y: -59; x: 5; x: 999; } |
1 change: 1 addition & 0 deletions
1
spec/libsass/variable-scoping/root-scope/expected.compressed.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
div{x:-9;y:-9}div for{y:-79;x:1;x:999;y:-74;x:2;x:999;y:-69;x:3;x:999;y:-64;x:4;x:999;y:-59;x:5;x:999} |
21 changes: 21 additions & 0 deletions
21
spec/libsass/variable-scoping/root-scope/expected.expanded.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
div { | ||
x: -9; | ||
y: -9; | ||
} | ||
div for { | ||
y: -79; | ||
x: 1; | ||
x: 999; | ||
y: -74; | ||
x: 2; | ||
x: 999; | ||
y: -69; | ||
x: 3; | ||
x: 999; | ||
y: -64; | ||
x: 4; | ||
x: 999; | ||
y: -59; | ||
x: 5; | ||
x: 999; | ||
} |
19 changes: 19 additions & 0 deletions
19
spec/libsass/variable-scoping/root-scope/expected_output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
div { | ||
x: -9; | ||
y: -9; } | ||
div for { | ||
y: -79; | ||
x: 1; | ||
x: 999; | ||
y: -74; | ||
x: 2; | ||
x: 999; | ||
y: -69; | ||
x: 3; | ||
x: 999; | ||
y: -64; | ||
x: 4; | ||
x: 999; | ||
y: -59; | ||
x: 5; | ||
x: 999; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$x: -42; | ||
$y: -84; | ||
div { | ||
for { | ||
@for $x from 1 through 5 { | ||
$y: $y + 5; | ||
y: $y; | ||
x: $x; | ||
$x: 999; | ||
x: $x; | ||
$y: -9 !global; | ||
$x: -9 !global; | ||
} | ||
} | ||
x: $x; | ||
y: $y; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo { foo: 42; bar: 43; baz: 45; foo: 42; bar: 4; baz: 45; foo: 3; bar: 5; baz: 45; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo{foo:42;bar:43;baz:45;foo:42;bar:4;baz:45;foo:3;bar:5;baz:45} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
foo { | ||
foo: 42; | ||
bar: 43; | ||
baz: 45; | ||
foo: 42; | ||
bar: 4; | ||
baz: 45; | ||
foo: 3; | ||
bar: 5; | ||
baz: 45; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
foo { | ||
foo: 42; | ||
bar: 43; | ||
baz: 45; | ||
foo: 42; | ||
bar: 4; | ||
baz: 45; | ||
foo: 3; | ||
bar: 5; | ||
baz: 45; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$foo: 42; | ||
$bar: 43; | ||
$baz: 45; | ||
|
||
foo { | ||
foo: $foo; | ||
bar: $bar; | ||
baz: $baz; | ||
|
||
$bar: 4; // this is a different $bar than `$bar !global` | ||
|
||
foo: $foo; | ||
bar: $bar; | ||
baz: $baz; | ||
|
||
@if true { | ||
$foo: 3; // this is a different $foo than `$foo !global` | ||
$bar: 5; // this is a different $bar than `$bar !global` | ||
|
||
foo: $foo; | ||
bar: $bar; | ||
baz: $baz; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { content: 42; } | ||
|
||
.bar { content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.foo{content:42}.bar{content:1337} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.foo { | ||
content: 42; | ||
} | ||
|
||
.bar { | ||
content: 1337; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.foo { | ||
content: 42; } | ||
|
||
.bar { | ||
content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$foo: 42; | ||
|
||
.foo { | ||
content: $foo; | ||
} | ||
|
||
@each $item in 1337 { | ||
$foo: $item !global; | ||
} | ||
|
||
.bar { | ||
content: $foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { content: 42; } | ||
|
||
.bar { content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.foo{content:42}.bar{content:1337} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.foo { | ||
content: 42; | ||
} | ||
|
||
.bar { | ||
content: 1337; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.foo { | ||
content: 42; } | ||
|
||
.bar { | ||
content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$foo: 42; | ||
|
||
.foo { | ||
content: $foo; | ||
} | ||
|
||
@for $i from 1337 to 1338 { | ||
$foo: $i !global; | ||
} | ||
|
||
.bar { | ||
content: $foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { content: 42; } | ||
|
||
.bar { content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.foo{content:42}.bar{content:1337} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.foo { | ||
content: 42; | ||
} | ||
|
||
.bar { | ||
content: 1337; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.foo { | ||
content: 42; } | ||
|
||
.bar { | ||
content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$foo: 42; | ||
|
||
.foo { | ||
content: $foo; | ||
} | ||
|
||
@function foo() { | ||
$foo: 1337 !global; | ||
@return $foo; | ||
} | ||
|
||
@if foo() {} | ||
|
||
.bar { | ||
content: $foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { content: 42; } | ||
|
||
.bar { content: 1337; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.foo{content:42}.bar{content:1337} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.foo { | ||
content: 42; | ||
} | ||
|
||
.bar { | ||
content: 1337; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.foo { | ||
content: 42; } | ||
|
||
.bar { | ||
content: 1337; } |
Oops, something went wrong.