Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge origin/master into feature.use #1436

Merged
merged 81 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
e50b242
Make specs for adjust-color() style-guide-compliant
nex3 May 30, 2019
5d73cd3
Make specs for scale-color() style-guide-compliant
nex3 May 31, 2019
6d8b652
Make specs for change-color() style-guide-compliant
nex3 May 31, 2019
dac8f52
Make specs for ie-hex-str() style-guide-compliant
nex3 May 31, 2019
a24d817
Merge pull request #1405 from sass/color-fns
nex3 Jun 18, 2019
f5c83c0
Materialize parent HRX directories if necessary (#1408)
nex3 Jun 19, 2019
8ca5ff4
Make specs for percentage() style-guide-compliant
nex3 Jun 13, 2019
b0edd65
Make specs for round() style-guide-compliant
nex3 Jun 13, 2019
5b7bf63
Make specs for ceil() style-guide-compliant
nex3 Jun 13, 2019
154887b
Make specs for floor() style-guide-compliant
nex3 Jun 13, 2019
53a8027
Make specs for abs() style-guide-compliant
nex3 Jun 13, 2019
ebf9384
Make specs for max() and min() style-guide-compliant
nex3 Jun 13, 2019
7526f02
Make specs for random() style-guide-compliant
nex3 Jun 13, 2019
fb32335
Make specs for unit() style-guide-compliant
nex3 Jun 13, 2019
96b9625
Make specs for unitless() style-guide-compliant
nex3 Jun 13, 2019
dde5196
Make specs for comparable() style-guide-compliant
nex3 Jun 13, 2019
214b086
Update deprecation warnings (#1409)
nex3 Jun 19, 2019
89531ae
Merge pull request #1410 from sass/math-fns
nex3 Jun 19, 2019
7071a54
Update specs for merging Dart Sass's feature.use into master (#1411)
nex3 Jun 24, 2019
5c19330
Make specs for unquote() style-guide-compliant
nex3 Jun 13, 2019
173e3ad
Make specs for quote() style-guide-compliant
nex3 Jun 13, 2019
f2f5ecd
Make specs for str-length() style-guide-compliant
nex3 Jun 13, 2019
4650635
Make specs for str-insert() style-guide-compliant
nex3 Jun 13, 2019
cbf9604
Move existing list specs into core_functions/list
nex3 May 25, 2019
e4e3357
Always add spec/ to the load path
nex3 Jun 27, 2019
e523c86
Add a utility library for dealing with internal representations
nex3 Jun 27, 2019
3fc2942
Make specs for length() style-guide-compliant
nex3 Jun 26, 2019
e04521e
Make specs for nth() style-guide-compliant
nex3 Jun 26, 2019
460f9ae
Make specs for set-nth() style-guide-compliant
nex3 Jun 26, 2019
7e0a16d
Make specs for str-index() style-guide-compliant
nex3 Jun 17, 2019
a8027d8
Make specs for str-slice() style-guide-compliant
nex3 Jun 25, 2019
9bfa0fd
Make specs for to-{upper,lower}-case() style-guide-compliant
nex3 Jun 25, 2019
8192bea
Make specs for unique-id() style-guide-compliant
nex3 Jun 25, 2019
29691e5
Merge pull request #1414 from sass/string-fns
nex3 Jun 27, 2019
0f27dd0
Make specs for map-get() style-guide-compliant
nex3 Jun 28, 2019
dce3297
Make specs for map-merge() style-guide-compliant
nex3 Jun 28, 2019
0d7e342
Make specs for map-remove() style-guide-compliant
nex3 Jun 28, 2019
7047d45
Make specs for map-keys() and map-values() style-guide-compliant
nex3 Jun 28, 2019
fdc466a
Make specs for map-has-key() style-guide-compliant
nex3 Jun 28, 2019
52b3a8b
Copy the structure of spec/core_functions/meta from feature.use
nex3 Jun 28, 2019
1d4833b
Make specs for feature-exists() style-guide-compliant
nex3 Jun 28, 2019
956ba94
Make specs for inspect() style-guide-compliant
nex3 Jun 28, 2019
822edb5
Make specs for type-of() style-guide-compliant
nex3 Jun 29, 2019
39798c5
Make specs for keywords() style-guide-compliant
nex3 Jun 29, 2019
a8468bd
Make specs for content-exists() style-guide-compliant
nex3 Jun 29, 2019
64d1462
Make specs for join() style-guide-compliant
nex3 Jun 26, 2019
b959e6d
Make specs for append() style-guide-compliant
nex3 Jun 26, 2019
0efc959
Make specs for zip() style-guide-compliant
nex3 Jun 26, 2019
78fb72d
Make specs for index() style-guide-compliant
nex3 Jun 27, 2019
8d7f806
Make specs for list-separator() style-guide-compliant
nex3 Jun 27, 2019
efabfbc
Make specs for is-bracketed() style-guide-compliant
nex3 Jun 27, 2019
30b1d70
Merge pull request #1419 from sass/map-fns
nex3 Jul 2, 2019
9fac896
Make specs for call() style-guide-compliant
nex3 Jul 2, 2019
11dc448
Merge pull request #1416 from sass/list-fn
nex3 Jul 2, 2019
8a96572
Allow GitHub issue TODOs to be automatically removed (#1423)
nex3 Jul 2, 2019
e65c52a
Update Dart Sass specs for saturate()
nex3 Jul 2, 2019
57e60b0
Update Dart Sass specs for alpha()
nex3 Jul 2, 2019
1394c0b
Update Dart Sass spec for invert(..., 50%)
nex3 Jul 2, 2019
c9dd1e4
Update Dart Sass spec for plain-CSS invert() with a weight
nex3 Jul 2, 2019
7313393
Update Dart Sass spec for adjust-color() with $hue and $alpha
nex3 Jul 2, 2019
57e2a05
Update Dart Sass spec for str-slice() with astral plane characters
nex3 Jul 2, 2019
43d1a4d
Update Dart Sass spec for str-insert() with $index -1
nex3 Jul 2, 2019
ae26bc0
Update Dart Sass specs for empty map separators
nex3 Jul 3, 2019
ef647e9
Update Dart Sass specs for join() and append() $separator errors
nex3 Jul 3, 2019
5951337
Update Dart Sass spec for zip() with no arguments
nex3 Jul 3, 2019
27efe6f
Update Dart Sass spec for map-remove() with a named $key argument
nex3 Jul 3, 2019
d8dc38c
Merge pull request #1424 from sass/dart-sass-fixes
nex3 Jul 4, 2019
07102ee
Allow arguments to be passed to any command
mgreter Jul 8, 2019
7cb62b5
Merge pull request #1426 from mgreter/feature/proxy-cmd-args
mgreter Jul 9, 2019
72957a1
Make Dart Sass errors the default in spec/get-function
nex3 Jul 10, 2019
6d301b1
Code review changes
nex3 Jul 11, 2019
d197951
Merge pull request #1422 from sass/meta-fns
nex3 Jul 11, 2019
e7e2af8
Merge spec/directives/import/nested into a single HRX
nex3 Jul 11, 2019
f686457
Add specs for at-rules in nested imports
nex3 Jul 11, 2019
a62d330
Merge pull request #1429 from sass/nested-import-keyframes
nex3 Jul 12, 2019
3484624
Fix a filename typo (#1431)
kaj Jul 15, 2019
60875af
fix: Enable for libsass 2894 (#1421)
nschonni Jul 15, 2019
a838a41
fix: Enable libsass 2914 (#1420)
nschonni Jul 15, 2019
b7cc904
Update feature-exists() specs for sass/libsass#2929 (#1434)
nex3 Jul 15, 2019
3f45fb6
Fix typo in silent comment error message (#1432)
mgreter Jul 15, 2019
d0d1985
Merge remote-tracking branch 'origin/master' into feature.use
nex3 Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/sass_spec/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ def self.parse

opts.on("-c", "--command COMMAND", "Sets a specific binary to run") do |v|
options[:engine_adapter] = ExecutableEngineAdapter.new(v)
options[:engine_adapter].args = options[:cmd_args]
end

opts.on("--dart PATH", "Run Dart Sass, whose repo should be at the given path.") do |path|
options[:engine_adapter] = DartEngineAdapter.new(path)
options[:engine_adapter].args = options[:dart_args]
options[:engine_adapter].args = options[:cmd_args]
end

opts.on("--dart-args ARGS", "Pass ARGS to Dart Sass.") do |args|
opts.on("--cmd-args ARGS", "Pass ARGS to command or Dart Sass.") do |args|
if (adapter = options[:engine_adapter]) && adapter.is_a?(DartEngineAdapter)
adapter.args = args
elsif (adapter = options[:engine_adapter]) && adapter.is_a?(ExecutableEngineAdapter)
adapter.args = args
else
options[:dart_args] = args
options[:cmd_args] = args
end
end

Expand Down
23 changes: 10 additions & 13 deletions lib/sass_spec/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,14 @@ def delete_dir!
def with_real_files
return yield unless @archive

files = @archive.entries.select {|entry| entry.is_a?(HRX::File)}

# If any files in this directory contain "../"s that reach out of this
# directory, materialize the appropriate level of parent directory instead.
if parent.hrx? &&
files.any? do |file|
levels_up = file.content.
scan(%r{(?:\.\./)+}).
map {|s| s.count("/")}.
max
(levels_up || 0) > file.path.count("/")
end
files = @archive.entries.select {|entry| entry.is_a?(HRX::File)}.to_a
if parent.hrx? && files.any? {|file| _reaches_out?(file)}
return parent.with_real_files {yield}
end

outermost_new_dir = SassSpec::Util.each_directory(@path).find {|dir| !Dir.exist?(dir)}

@archive.entries.select {|entry| entry.is_a?(HRX::File)}.each do |file|
files.each do |file|
path = File.join(@path, file.path)
FileUtils.mkdir_p(File.dirname(path))
File.write(path, file.content)
Expand Down Expand Up @@ -210,6 +200,13 @@ def to_s

private

# Returns whether `file` contains enough `../` references to reach outside
# this directory.
def _reaches_out?(file)
depth = file.path.count("/")
file.content.scan(%r{(?:\.\./)+}).any? {|match| match.count("/") > depth}
end

# Writes `@parent_archive` to disk.
def _write!
@parent_archive.write!(@parent_archive_path)
Expand Down
7 changes: 5 additions & 2 deletions lib/sass_spec/engine_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def not_implemented

class ExecutableEngineAdapter < EngineAdapter
include CaptureWithTimeout
attr_accessor :args

def initialize(command, description = nil)
@command = command
Expand All @@ -42,7 +43,8 @@ def compile(sass_filename, precision)
command = File.absolute_path(@command)
dirname, basename = File.split(sass_filename)
result = capture3_with_timeout(
command, "--precision", precision.to_s, "-t", "expanded", basename,
command, "--precision", precision.to_s, "-t", "expanded",
"-I", File.absolute_path("spec"), *@args&.split(/\s+/), basename,
binmode: true, timeout: @timeout, chdir: dirname)

if result[:timeout]
Expand Down Expand Up @@ -107,7 +109,8 @@ def describe
def compile(sass_filename, precision)
dirname, basename = File.split(sass_filename)
@stdin.puts "!cd #{File.absolute_path(dirname)}"
@stdin.puts "--no-color --no-unicode #{@args} #{basename}"
@stdin.puts("--no-color --no-unicode -I #{File.absolute_path("spec")} " +
"#{@args} #{basename}")
[next_chunk(@stdout), next_chunk(@stderr), next_chunk(@stdout).to_i]
end

Expand Down
37 changes: 22 additions & 15 deletions lib/sass_spec/test_case_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ def self.merge_options(existing_opts, new_opts)
existing_opts = existing_opts.dup

new_opts.each do |key, value|
if key =~ /add_(.*)/
key = $1.to_sym
existing_opts[key] ||= []
value.each do |v|
existing_opts[key] << v
end
existing_opts[key].uniq!
elsif key =~ /remove_(.*)/
key = $1.to_sym
existing_opts[key] ||= []
value.each do |v|
existing_opts[key].delete(v)
end
existing_opts.delete(key) if existing_opts[key].empty?
if added_key = key[/^add_(.*)/, 1]
added_key = added_key.to_sym
(existing_opts[added_key] ||= [])
.concat(value)
.uniq!
elsif removed_key = key[/^remove_((?:warning_)?todo)/, 1]
removed_key = removed_key.to_sym
(existing_opts[removed_key] ||= [])
.delete_if {|name| value.include?(_normalize_todo(name))}
existing_opts.delete(removed_key) if existing_opts[removed_key].empty?
elsif removed_key = key[/^remove_(.*)/, 1]
removed_key = removed_key.to_sym
(existing_opts[removed_key] ||= [])
.delete_if {|name| value.include?(name)}
existing_opts.delete(removed_key) if existing_opts[removed_key].empty?
elsif value.nil?
existing_opts.delete(key)
else
Expand Down Expand Up @@ -84,11 +85,17 @@ def _resolve_options(dir)
def _normalize_todos(options, field)
if options.include?(field)
options[field] = options[field]
.map {|name| name =~ %r{^sass/(.*)#} ? $1 : name}
.map {|name| self.class._normalize_todo(name)}
.to_set
end
end

# Normalize a single TODO value to convert a GitHub issue reference to an
# implementation name.
def self._normalize_todo(value)
value =~ %r{^sass/(.*)#} ? $1 : value
end

def todo?(impl)
@options[:todo] && @options[:todo].include?(impl)
end
Expand Down
9 changes: 0 additions & 9 deletions spec/basic/43_str_length/input.scss

This file was deleted.

9 changes: 0 additions & 9 deletions spec/basic/43_str_length/output.css

This file was deleted.

26 changes: 0 additions & 26 deletions spec/basic/45_str_insert/input.scss

This file was deleted.

25 changes: 0 additions & 25 deletions spec/basic/45_str_insert/output.css

This file was deleted.

15 changes: 0 additions & 15 deletions spec/basic/46_str_index/input.scss

This file was deleted.

13 changes: 0 additions & 13 deletions spec/basic/46_str_index/output.css

This file was deleted.

42 changes: 0 additions & 42 deletions spec/basic/48_case_conversion.hrx

This file was deleted.

75 changes: 0 additions & 75 deletions spec/basic/60_call.hrx

This file was deleted.

14 changes: 0 additions & 14 deletions spec/colors/adjust-color.hrx

This file was deleted.

Loading