Skip to content

Commit

Permalink
Fixes #311 add more parent selector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robocoder committed Jul 31, 2015
1 parent 331a7fc commit be55b9e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
13 changes: 13 additions & 0 deletions tests/inputs/selectors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ div {
&.foo & {
color: blue;
}
& + & {
color: green;
}
}

.main, div {
Expand Down Expand Up @@ -266,4 +269,14 @@ $all: $span, $p, $div;
#{$selfMultiple} {
content: "should match .parent.self1, .parent.self2";
}

$trailingSelf: unquote(".self1 &");
#{$trailingSelf} {
content: "should match .self1 .parent";
}

$doubleSelf: unquote("& + &");
#{$doubleSelf} {
content: "should match .parent + .parent";
}
}
6 changes: 6 additions & 0 deletions tests/outputs/selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ div {

div.foo div {
color: blue; }
div + div {
color: green; }

.nice-fonts .main .message div .title, .nice-fonts div .message div .title {
font-size: 24px; }
Expand Down Expand Up @@ -361,3 +363,7 @@ span a, p a, div a {

.parent.self1, .parent.self2 {
content: "should match .parent.self1, .parent.self2"; }
.self1 .parent {
content: "should match .self1 .parent"; }
.parent + .parent {
content: "should match .parent + .parent"; }
47 changes: 28 additions & 19 deletions tests/outputs_numbered/selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,52 +344,61 @@ div font:something {

div.foo div {
color: blue; }
/* line 178, inputs/selectors.scss */
/* line 179, inputs/selectors.scss */
/* line 176, inputs/selectors.scss */
div + div {
color: green; }
/* line 181, inputs/selectors.scss */
/* line 182, inputs/selectors.scss */

/* line 180, inputs/selectors.scss */
/* line 181, inputs/selectors.scss */
/* line 183, inputs/selectors.scss */
/* line 184, inputs/selectors.scss */
.nice-fonts .main .message div .title, .nice-fonts div .message div .title {
font-size: 24px; }
/* line 189, inputs/selectors.scss */
/* line 192, inputs/selectors.scss */
.escape\% {
color: red; }
/* line 193, inputs/selectors.scss */
/* line 196, inputs/selectors.scss */
.escape-plan\% {
color: green; }
/* line 197, inputs/selectors.scss */
/* line 198, inputs/selectors.scss */
/* line 200, inputs/selectors.scss */
/* line 201, inputs/selectors.scss */

.element .one, .element .two {
property: value; }
/* line 225, inputs/selectors.scss */
/* line 220, inputs/selectors.scss */
/* line 228, inputs/selectors.scss */
/* line 223, inputs/selectors.scss */

#secondary h1, #secondary h2, #secondary h3, #secondary h4, #secondary h5, #secondary h6 {
color: #e6e6e6; }
/* line 232, inputs/selectors.scss */
/* line 233, inputs/selectors.scss */
/* line 235, inputs/selectors.scss */
/* line 236, inputs/selectors.scss */

.test foo, .test bar {
border: 1px dashed red; }
/* line 244, inputs/selectors.scss */
/* line 245, inputs/selectors.scss */
/* line 247, inputs/selectors.scss */
/* line 248, inputs/selectors.scss */

span a, p a, div a {
color: red; }
/* line 250, inputs/selectors.scss */
/* line 253, inputs/selectors.scss */
/* line 256, inputs/selectors.scss */

.parent.self {
content: "should match .parent.self"; }
/* line 256, inputs/selectors.scss */
/* line 259, inputs/selectors.scss */
.parent .child {
content: "should match .parent .child"; }
/* line 259, inputs/selectors.scss */
/* line 262, inputs/selectors.scss */
.parent.self2 {
content: "should match .parent.self2"; }
/* line 264, inputs/selectors.scss */
/* line 266, inputs/selectors.scss */
/* line 267, inputs/selectors.scss */
/* line 269, inputs/selectors.scss */

.parent.self1, .parent.self2 {
content: "should match .parent.self1, .parent.self2"; }
/* line 274, inputs/selectors.scss */
.self1 .parent {
content: "should match .self1 .parent"; }
/* line 279, inputs/selectors.scss */
.parent + .parent {
content: "should match .parent + .parent"; }

0 comments on commit be55b9e

Please sign in to comment.