Skip to content

Commit 544d0ab

Browse files
authored
Merge pull request #1466 from sass/merge-master
Merge master into feature.use
2 parents becf518 + 701f077 commit 544d0ab

File tree

101 files changed

+3689
-918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3689
-918
lines changed

.travis.yml

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
sudo: false
2-
31
language: ruby
42

53
# Only building master means that we don't run two builds for each pull request.
@@ -9,42 +7,33 @@ branches:
97
# Feature branches beginning with "feature."
108
- "/^feature\\..*/"
119

12-
env:
13-
global:
14-
- SASS_LIBSASS_PATH=$TRAVIS_BUILD_DIR/../libsass
15-
- SASS_SASSC_PATH=$TRAVIS_BUILD_DIR/../sassc
16-
- SASS_SPEC_PATH=~$TRAVIS_BUILD_DIR/sass-spec
17-
1810
matrix:
1911
fast_finish: true
2012
include:
21-
- env: IMPL=libsass COMMAND="../sassc/bin/sassc"
22-
- env: IMPL=dart-sass
13+
- name: "LibSass"
14+
env:
15+
- IMPL=libsass
16+
- COMMAND="../sassc/bin/sassc"
17+
- SASS_LIBSASS_PATH=$TRAVIS_BUILD_DIR/../libsass
18+
- SASS_SASSC_PATH=$TRAVIS_BUILD_DIR/../sassc
19+
- SASS_SPEC_PATH=~$TRAVIS_BUILD_DIR/sass-spec
20+
before_script:
21+
- git clone https://github.com/sass/libsass.git $SASS_LIBSASS_PATH
22+
- (cd $SASS_LIBSASS_PATH; git checkout $GITISH)
23+
- git clone https://github.com/sass/sassc.git $SASS_SASSC_PATH
24+
- (cd $SASS_SASSC_PATH; git checkout $GITISH)
25+
- make -C $SASS_SASSC_PATH
26+
script: bundle exec sass-spec.rb --impl $IMPL -c $COMMAND;
27+
- name: "Dart Sass"
28+
env: IMPL=dart-sass
29+
before_script:
30+
- curl -o dart.zip "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip"
31+
- unzip dart.zip
32+
- export PATH="$PATH:`pwd`/dart-sdk/bin"
33+
- git clone https://github.com/sass/dart-sass.git ../dart-sass --depth 1 --branch feature.use
34+
- (cd ../dart-sass; pub get)
35+
script: bundle exec sass-spec.rb --dart ../dart-sass
2336

2437
before_install:
2538
- if ./tools/skipped-for-impl.sh; then exit 0; fi
2639
- rm Gemfile.lock
27-
28-
- if [ $IMPL == "libsass" ]; then
29-
git clone https://github.com/sass/libsass.git $SASS_LIBSASS_PATH;
30-
(cd $SASS_LIBSASS_PATH; git checkout $GITISH);
31-
git clone https://github.com/sass/sassc.git $SASS_SASSC_PATH;
32-
(cd $SASS_SASSC_PATH; git checkout $GITISH);
33-
make -C $SASS_SASSC_PATH;
34-
fi
35-
36-
- if [ $IMPL == "dart-sass" ]; then
37-
curl -o dart.zip "https://storage.googleapis.com/dart-archive/channels/dev/release/latest/sdk/dartsdk-linux-x64-release.zip";
38-
unzip dart.zip;
39-
export PATH="$PATH:`pwd`/dart-sdk/bin";
40-
41-
git clone https://github.com/sass/dart-sass.git ../dart-sass --depth 1 --branch feature.use;
42-
(cd ../dart-sass; pub get);
43-
fi
44-
45-
script:
46-
- if [ $IMPL == "dart-sass" ]; then
47-
bundle exec sass-spec.rb --dart ../dart-sass;
48-
else
49-
bundle exec sass-spec.rb --impl $IMPL -c $COMMAND;
50-
fi

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ gem "command_line_reporter", '~> 3.0'
55
gem "ruby-terminfo", '~> 0.1.1'
66
gem "diffy", '~> 3.1'
77
gem "hrx", '~> 1.0'
8+
9+
gem 'rspec'

Gemfile.lock

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ GEM
44
colored (1.2)
55
command_line_reporter (3.3.6)
66
colored (>= 1.2)
7+
diff-lcs (1.3)
78
diffy (3.3.0)
89
hrx (1.0.0)
910
linked-list (~> 0.0.13)
1011
linked-list (0.0.13)
1112
minitest (5.11.3)
13+
rspec (3.8.0)
14+
rspec-core (~> 3.8.0)
15+
rspec-expectations (~> 3.8.0)
16+
rspec-mocks (~> 3.8.0)
17+
rspec-core (3.8.2)
18+
rspec-support (~> 3.8.0)
19+
rspec-expectations (3.8.4)
20+
diff-lcs (>= 1.2.0, < 2.0)
21+
rspec-support (~> 3.8.0)
22+
rspec-mocks (3.8.1)
23+
diff-lcs (>= 1.2.0, < 2.0)
24+
rspec-support (~> 3.8.0)
25+
rspec-support (3.8.2)
1226
ruby-terminfo (0.1.1)
1327

1428
PLATFORMS
@@ -19,7 +33,8 @@ DEPENDENCIES
1933
diffy (~> 3.1)
2034
hrx (~> 1.0)
2135
minitest (~> 5.8)
36+
rspec
2237
ruby-terminfo (~> 0.1.1)
2338

2439
BUNDLED WITH
25-
1.16.2
40+
2.0.2

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,11 @@ X. Exit testing.
283283
Any option can also be applied to all future occurences of that type of failure
284284
by adding `!` after it. For example, if you want to mark *all* failing specs as
285285
`:todo` for the current implementation you'd type `I!`.
286+
287+
## Tests
288+
The unit tests for the spec runner are located in the `tests/` directory. To
289+
run these unit tests, run:
290+
291+
```sh
292+
bundle exec rspec tests/
293+
```

STYLE_GUIDE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ an exception. Thorough testing trumps style.
4343
* [DO use type selectors as placeholders](#do-use-type-selectors-as-placeholders)
4444
* [DO use descriptive names for multiple placeholders](#do-use-descriptive-names-for-multiple-placeholders)
4545
* [DO use single-letter names for irrelevant placeholders](#do-use-single-letter-names-for-irrelevant-placeholders)
46+
* [DO use `pfx` for vendor prefixes](#do-use-pfx-for-vendor-prefixes)
4647
* [DO use style rules for expression-level tests](#do-use-style-rules-for-expression-level-tests)
4748
* [PREFER making imported files partials](#prefer-making-imported-files-partials)
4849
* [DO name single imported or used files "other"](#do-name-single-imported-or-used-files-other)
@@ -617,6 +618,45 @@ property name.
617618
[its path]: #do-use-descriptive-paths
618619
[one thing]: #do-test-only-one-thing-per-spec
619620

621+
### DO use `pfx` for vendor prefixes
622+
623+
<details>
624+
<summary>Example</summary>
625+
626+
#### Good
627+
628+
```hrx
629+
<===> input.scss
630+
a {b: is-superselector(":-pfx-matches(c d)", "c d")}
631+
632+
<===> output.css
633+
a {
634+
b: true;
635+
}
636+
```
637+
638+
#### Bad
639+
640+
```hrx
641+
<===> input.scss
642+
a {b: is-superselector(":-webkit-matches(c d)", "c d")}
643+
644+
<===> output.css
645+
a {
646+
b: true;
647+
}
648+
```
649+
650+
</details>
651+
652+
There are a few situation in which Sass specifically parses vendor prefixes. In
653+
these cases, *all* vendor prefixes should be treated equivalently, whether
654+
they're from a real browser or not. To test this, use the non-existent vendor
655+
prefix `pfx`.
656+
657+
If multiple different vendor prefixes are needed, index them by letter, as
658+
`-pfxa-`, `-pfxb`, and so on.
659+
620660
### DO use style rules for expression-level tests
621661

622662
<details>

spec/core_functions/color/invert.hrx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ Error: wrong number of arguments (3 for 2) for `invert'
158158

159159
<===>
160160
================================================================================
161-
<===> error/number_with_weight/options.yml
162-
---
163-
:todo:
164-
- sass/libsass#2899
165-
166161
<===> error/number_with_weight/input.scss
167162
a {b: invert(1, 50%)}
168163

spec/core_functions/meta/function_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ a {
3535
b: true;
3636
}
3737

38+
<===>
39+
================================================================================
40+
<===> same_module/dash_insensitive/dash_to_underscore/input.scss
41+
@function a_b() {@return null}
42+
43+
c {d: function-exists(a-b)}
44+
45+
<===> same_module/dash_insensitive/dash_to_underscore/output.css
46+
c {
47+
d: true;
48+
}
49+
50+
<===>
51+
================================================================================
52+
<===> same_module/dash_insensitive/underscore_to_dash/input.scss
53+
@function a-b() {@return null}
54+
55+
c {d: function-exists(a_b)}
56+
57+
<===> same_module/dash_insensitive/underscore_to_dash/output.css
58+
c {
59+
d: true;
60+
}
61+
3862
<===>
3963
================================================================================
4064
<===> same_module/non_existent/input.scss

spec/core_functions/meta/get_function/same_module.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,27 @@ a {
6969
sass-fn: #ff9999;
7070
css-fn: lighten(red, 30%);
7171
}
72+
73+
<===>
74+
================================================================================
75+
<===> dash_insensitive/dash_to_underscore/input.scss
76+
@function add_two($v) {@return $v + 2}
77+
78+
a {b: call(get-function(add-two), 10)}
79+
80+
<===> dash_insensitive/dash_to_underscore/output.css
81+
a {
82+
b: 12;
83+
}
84+
85+
<===>
86+
================================================================================
87+
<===> dash_insensitive/underscore_to_dash/input.scss
88+
@function add-two($v) {@return $v + 2}
89+
90+
a {b: call(get-function(add_two), 10)}
91+
92+
<===> dash_insensitive/underscore_to_dash/output.css
93+
a {
94+
b: 12;
95+
}

spec/core_functions/meta/global_variable_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ a {
3535
b: true;
3636
}
3737

38+
<===>
39+
================================================================================
40+
<===> dash_insensitive/dash_to_underscore/input.scss
41+
$a_b: null;
42+
43+
c {d: global-variable-exists(a-b)}
44+
45+
<===> dash_insensitive/dash_to_underscore/output.css
46+
c {
47+
d: true;
48+
}
49+
50+
<===>
51+
================================================================================
52+
<===> dash_insensitive/underscore_to_dash/input.scss
53+
$a-b: null;
54+
55+
c {d: global-variable-exists(a_b)}
56+
57+
<===> dash_insensitive/underscore_to_dash/output.css
58+
c {
59+
d: true;
60+
}
61+
3862
<===>
3963
================================================================================
4064
<===> same_module/non_existent/input.scss

spec/core_functions/meta/variable_exists.hrx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ a {
2121
b: true;
2222
}
2323

24+
<===>
25+
================================================================================
26+
<===> dash_insensitive/dash_to_underscore/input.scss
27+
$a_b: null;
28+
29+
c {d: variable-exists(a-b)}
30+
31+
<===> dash_insensitive/dash_to_underscore/output.css
32+
c {
33+
d: true;
34+
}
35+
36+
<===>
37+
================================================================================
38+
<===> dash_insensitive/underscore_to_dash/input.scss
39+
$a-b: null;
40+
41+
c {d: variable-exists(a_b)}
42+
43+
<===> dash_insensitive/underscore_to_dash/output.css
44+
c {
45+
d: true;
46+
}
47+
2448
<===>
2549
================================================================================
2650
<===> through_import/input.scss

0 commit comments

Comments
 (0)