diff --git a/spec/functions/set-nth/map/comma-list/expected_output.css b/spec/functions/set-nth/map/comma-list/expected_output.css new file mode 100644 index 0000000000..37668065e7 --- /dev/null +++ b/spec/functions/set-nth/map/comma-list/expected_output.css @@ -0,0 +1,9 @@ +foo { + set: red 50px, number 20px; + set-type: list; + before: (key: value, number: 20px); + after: (red 50px, null), number 20px; + length: 2; + key: red 50px; + key-type: list; + value1-type: null; } diff --git a/spec/functions/set-nth/map/comma-list/input.scss b/spec/functions/set-nth/map/comma-list/input.scss new file mode 100644 index 0000000000..8ce2dc3ee2 --- /dev/null +++ b/spec/functions/set-nth/map/comma-list/input.scss @@ -0,0 +1,19 @@ +$map : ( + key : value, + number : 20px +); + +$index: 1; +$val: red 50px, null; + +foo { + set: set-nth($map, $index, $val); + set-type: type-of(set-nth($map, $index, $val)); + before: inspect($map); + $map: set-nth($map, $index, $val); + after: inspect($map); + length: length(nth($map, $index)); + key: inspect(nth(nth($map, $index), 1)); + key-type: type-of(nth(nth($map, $index), 1)); + value1-type: type-of(nth(nth($map, $index), 2)); +} \ No newline at end of file diff --git a/spec/functions/set-nth/map/comma-lists/expected_output.css b/spec/functions/set-nth/map/comma-lists/expected_output.css new file mode 100644 index 0000000000..d350225b32 --- /dev/null +++ b/spec/functions/set-nth/map/comma-lists/expected_output.css @@ -0,0 +1,9 @@ +foo { + set: red 50px, , foobar, number 20px; + set-type: list; + before: (key: value, number: 20px); + after: (red 50px, null null, foobar), number 20px; + length: 3; + key: red 50px; + key-type: list; + value1-type: list; } diff --git a/spec/functions/set-nth/map/comma-lists/input.scss b/spec/functions/set-nth/map/comma-lists/input.scss new file mode 100644 index 0000000000..bc5c95d2c1 --- /dev/null +++ b/spec/functions/set-nth/map/comma-lists/input.scss @@ -0,0 +1,19 @@ +$map : ( + key : value, + number : 20px +); + +$index: 1; +$val: red 50px, null null, foobar; + +foo { + set: set-nth($map, $index, $val); + set-type: type-of(set-nth($map, $index, $val)); + before: inspect($map); + $map: set-nth($map, $index, $val); + after: inspect($map); + length: length(nth($map, $index)); + key: inspect(nth(nth($map, $index), 1)); + key-type: type-of(nth(nth($map, $index), 1)); + value1-type: type-of(nth(nth($map, $index), 2)); +} \ No newline at end of file diff --git a/spec/functions/set-nth/map/only-key/expected_output.css b/spec/functions/set-nth/map/only-key/expected_output.css new file mode 100644 index 0000000000..e59683d266 --- /dev/null +++ b/spec/functions/set-nth/map/only-key/expected_output.css @@ -0,0 +1,8 @@ +foo { + set: red, number 20px; + set-type: list; + before: (key: value, number: 20px); + after: red, number 20px; + length: 1; + key: red; + key-type: color; } diff --git a/spec/functions/set-nth/map/only-key/input.scss b/spec/functions/set-nth/map/only-key/input.scss new file mode 100644 index 0000000000..cb19406278 --- /dev/null +++ b/spec/functions/set-nth/map/only-key/input.scss @@ -0,0 +1,18 @@ +$map : ( + key : value, + number : 20px +); + +$index: 1; +$val: red; + +foo { + set: set-nth($map, $index, $val); + set-type: type-of(set-nth($map, $index, $val)); + before: inspect($map); + $map: set-nth($map, $index, $val); + after: inspect($map); + length: length(nth($map, $index)); + key: inspect(nth(nth($map, $index), 1)); + key-type: type-of(nth(nth($map, $index), 1)); +} \ No newline at end of file diff --git a/spec/functions/set-nth/map/options.yml b/spec/functions/set-nth/map/options.yml new file mode 100644 index 0000000000..51f18a5afb --- /dev/null +++ b/spec/functions/set-nth/map/options.yml @@ -0,0 +1,4 @@ +--- +:start_version: '3.4' +:todo: +- libsass diff --git a/spec/functions/set-nth/map/simple/expected_output.css b/spec/functions/set-nth/map/simple/expected_output.css new file mode 100644 index 0000000000..c2d842ee76 --- /dev/null +++ b/spec/functions/set-nth/map/simple/expected_output.css @@ -0,0 +1,9 @@ +foo { + set: red 50px, number 20px; + set-type: list; + before: (key: value, number: 20px); + after: red 50px, number 20px; + length: 2; + key: red; + key-type: color; + value-type: number; } diff --git a/spec/functions/set-nth/map/simple/input.scss b/spec/functions/set-nth/map/simple/input.scss new file mode 100644 index 0000000000..b108c0e2da --- /dev/null +++ b/spec/functions/set-nth/map/simple/input.scss @@ -0,0 +1,19 @@ +$map : ( + key : value, + number : 20px +); + +$index: 1; +$val: red 50px; + +foo { + set: set-nth($map, $index, $val); + set-type: type-of(set-nth($map, $index, $val)); + before: inspect($map); + $map: set-nth($map, $index, $val); + after: inspect($map); + length: length(nth($map, $index)); + key: inspect(nth(nth($map, $index), 1)); + key-type: type-of(nth(nth($map, $index), 1)); + value-type: type-of(nth(nth($map, $index), 2)); +} \ No newline at end of file diff --git a/spec/functions/set-nth/map/space-list/expected_output.css b/spec/functions/set-nth/map/space-list/expected_output.css new file mode 100644 index 0000000000..82ab2b82c6 --- /dev/null +++ b/spec/functions/set-nth/map/space-list/expected_output.css @@ -0,0 +1,10 @@ +foo { + set: red 50px, number 20px; + set-type: list; + before: (key: value, number: 20px); + after: red 50px null, number 20px; + length: 3; + key: red; + key-type: color; + value1-type: number; + value2-type: null; } diff --git a/spec/functions/set-nth/map/space-list/input.scss b/spec/functions/set-nth/map/space-list/input.scss new file mode 100644 index 0000000000..037e8a6027 --- /dev/null +++ b/spec/functions/set-nth/map/space-list/input.scss @@ -0,0 +1,20 @@ +$map : ( + key : value, + number : 20px +); + +$index: 1; +$val: red 50px null; + +foo { + set: set-nth($map, $index, $val); + set-type: type-of(set-nth($map, $index, $val)); + before: inspect($map); + $map: set-nth($map, $index, $val); + after: inspect($map); + length: length(nth($map, $index)); + key: inspect(nth(nth($map, $index), 1)); + key-type: type-of(nth(nth($map, $index), 1)); + value1-type: type-of(nth(nth($map, $index), 2)); + value2-type: type-of(nth(nth($map, $index), 3)); +} \ No newline at end of file