diff --git a/spec/values/calculation/mod.hrx b/spec/values/calculation/mod.hrx index e6dbf1d51..adcecedd4 100644 --- a/spec/values/calculation/mod.hrx +++ b/spec/values/calculation/mod.hrx @@ -80,6 +80,16 @@ a { b: mod(1px, 2bar); } +<===> +================================================================================ +<===> equals/input.scss +a {b: mod(1, 1)} + +<===> equals/output.css +a { + b: 0; +} + <===> ================================================================================ <===> positive_and_negative/input.scss @@ -322,3 +332,55 @@ Error: expected "+", "-", "*", "/", ",", or ")". | ^ ' input.scss 1:13 root stylesheet + +<===> +================================================================================ +<===> math/unknown_units/input.scss +a { + b: mod(1px + 0%, 1px + 0%); +} + +<===> math/unknown_units/output.css +a { + b: mod(1px + 0%, 1px + 0%); +} + +<===> +================================================================================ +<===> NaN/negative_zero_and_positive_infinity/input.scss +a {b: mod(-0, infinity)} + +<===> NaN/negative_zero_and_positive_infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> NaN/zero_and_negative_infinity/input.scss +a {b: mod(0, -infinity)} + +<===> NaN/zero_and_negative_infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> NaN/negative_and_positive_infinity/input.scss +a {b: mod(-5, infinity)} + +<===> NaN/negative_and_positive_infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> NaN/positive_and_negative_infinity/input.scss +a {b: mod(5, -infinity)} + +<===> NaN/positive_and_negative_infinity/output.css +a { + b: calc(NaN); +} diff --git a/spec/values/calculation/rem.hrx b/spec/values/calculation/rem.hrx index 02599679b..4015fdbf4 100644 --- a/spec/values/calculation/rem.hrx +++ b/spec/values/calculation/rem.hrx @@ -80,6 +80,16 @@ a { b: rem(1px, 2bar); } +<===> +================================================================================ +<===> equals/input.scss +a {b: rem(1, 1)} + +<===> equals/output.css +a { + b: 0; +} + <===> ================================================================================ <===> positive_and_negative/input.scss @@ -322,3 +332,57 @@ Error: expected "+", "-", "*", "/", ",", or ")". | ^ ' input.scss 1:13 root stylesheet + +<===> +================================================================================ +<===> math/unknown_units/input.scss +a { + b: rem(1px + 0%, 1px + 0%); +} + +<===> math/unknown_units/output.css +a { + b: rem(1px + 0%, 1px + 0%); +} + +<===> +================================================================================ +<===> negative_zero_and_positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, rem(-0, infinity))} + +<===> negative_zero_and_positive_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> zero_and_negative_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, rem(0, -infinity))} + +<===> zero_and_negative_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> negative_and_positive_infinity/input.scss +a {b: rem(-5, infinity)} + +<===> negative_and_positive_infinity/output.css +a { + b: -5; +} + +<===> +================================================================================ +<===> positive_and_negative_infinity/input.scss +a {b: rem(5, -infinity)} + +<===> positive_and_negative_infinity/output.css +a { + b: 5; +} diff --git a/spec/values/calculation/round/strategies/down.hrx b/spec/values/calculation/round/strategies/down.hrx new file mode 100644 index 000000000..cca0830e1 --- /dev/null +++ b/spec/values/calculation/round/strategies/down.hrx @@ -0,0 +1,197 @@ +<===> README.md +Most of the same behavior tested for `calc()` applies to `round()`, but for +terseness' sake isn't tested explicitly. + +<===> +================================================================================ +<===> strategy/down/step_is_multiple_of_number/input.scss +a {b: round(down, 5px, 25px)} + +<===> strategy/down/step_is_multiple_of_number/output.css +a { + b: 0px; +} + +<===> +================================================================================ +<===> strategy/down/number_is_multiple_of_step/input.scss +a {b: round(down, 25px, 5px)} + +<===> strategy/down/number_is_multiple_of_step/output.css +a { + b: 25px; +} + +<===> +================================================================================ +<===> strategy/down/positive/input.scss +a {b: round(down, 122px, 25px)} + +<===> strategy/down/positive/output.css +a { + b: 100px; +} + +<===> +================================================================================ +<===> strategy/down/negative/input.scss +a {b: round(down, -101, -25)} + +<===> strategy/down/negative/output.css +a { + b: -125; +} + +<===> +================================================================================ +<===> strategy/down/negative_step/input.scss +a {b: round(down, 12, -7)} + +<===> strategy/down/negative_step/output.css +a { + b: 7; +} + +<===> +================================================================================ +<===> strategy/down/infinity/input.scss +a {b: round(down, infinity, infinity)} + +<===> strategy/down/infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> strategy/down/step_is_zero/input.scss +a {b: round(down, 10px, 0px)} + +<===> strategy/down/step_is_zero/output.css +a { + b: calc(NaN * 1px); +} + +<===> +================================================================================ +<===> strategy/down/positive_and_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(down, 10, infinity))} + +<===> strategy/down/positive_and_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/down/negative_and_infinity/input.scss +@use "sass:math"; +a {b: round(down, -10, infinity)} + +<===> strategy/down/negative_and_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/down/upper_multiple/number_is_bigger/input.scss +a {b: round(down, 23px, 10px)} + +<===> strategy/down/upper_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/down/upper_multiple/number_is_smaller/input.scss +a {b: round(down, 18px, 10px)} + +<===> strategy/down/upper_multiple/number_is_smaller/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/down/upper_multiple/number_is_half/input.scss +a {b: round(down, 15px, 10px)} + +<===> strategy/down/upper_multiple/number_is_half/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/down/upper_multiple/number_is_negative/input.scss +a {b: round(down, -13px, 10px)} + +<===> strategy/down/upper_multiple/number_is_negative/output.css +a { + b: -20px; +} + +<===> +================================================================================ +<===> strategy/down/lower_multiple/number_is_bigger/input.scss +a {b: round(down, 13px, 10px)} + +<===> strategy/down/lower_multiple/number_is_bigger/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/down/lower_multiple/number_is_negative/input.scss +a {b: round(down, -18px, 10px)} + +<===> strategy/down/lower_multiple/number_is_negative/output.css +a { + b: -20px; +} + +<===> +================================================================================ +<===> strategy/down/negative_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(down, -1 * 0, infinity))} + +<===> strategy/down/negative_zero/positive_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/down/positive_zero/zero/input.scss +@use "sass:math"; +a {b: math.div(1, round(down, 0, infinity))} + +<===> strategy/down/positive_zero/zero/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/down/positive_zero/one/input.scss +a {b: round(down, 1, infinity)} + +<===> strategy/down/positive_zero/one/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/down/nested_function/input.scss +a {b: round(down, round(100, 10) + 2 * 3, 10)} + +<===> strategy/down/nested_function/output.css +a { + b: 100; +} diff --git a/spec/values/calculation/round/strategies/nearest.hrx b/spec/values/calculation/round/strategies/nearest.hrx new file mode 100644 index 000000000..2474bb266 --- /dev/null +++ b/spec/values/calculation/round/strategies/nearest.hrx @@ -0,0 +1,157 @@ +<===> README.md +Most of the same behavior tested for `calc()` applies to `round()`, but for +terseness' sake isn't tested explicitly. + +<===> +================================================================================ +<===> strategy/nearest/simplification/input.scss +a { + b: round(nearest, 3.8px - 1px + var(--test), 1.1px + 4px)} + +<===> strategy/nearest/simplification/output.css +a { + b: round(nearest, 2.8px + var(--test), 5.1px); +} + +<===> +================================================================================ +<===> strategy/nearest/positive/input.scss +a {b: round(nearest, 117px, 25px)} + +<===> strategy/nearest/positive/output.css +a { + b: 125px; +} + +<===> +================================================================================ +<===> strategy/nearest/negative/input.scss +a {b: round(nearest, -101, -25)} + +<===> strategy/nearest/negative/output.css +a { + b: -100; +} + +<===> +================================================================================ +<===> strategy/nearest/step_is_zero/input.scss +a {b: round(nearest, 10px, 0px)} + +<===> strategy/nearest/step_is_zero/output.css +a { + b: calc(NaN * 1px); +} + +<===> +================================================================================ +<===> strategy/nearest/positive_and_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(nearest, 10, infinity))} + +<===> strategy/nearest/positive_and_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/nearest/negative_and_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(nearest, -10, infinity))} + +<===> strategy/nearest/negative_and_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/nearest/infinity/input.scss +@use "sass:math"; +a {b: round(nearest, infinity, infinity)} + +<===> strategy/nearest/infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> strategy/nearest/step_is_multiple_of_number/input.scss +a {b: round(nearest, 5px, 25px)} + +<===> strategy/nearest/step_is_multiple_of_number/output.css +a { + b: 0px; +} + +<===> +================================================================================ +<===> strategy/nearest/number_is_multiple_of_step/input.scss +a {b: round(nearest, 25px, 5px)} + +<===> strategy/nearest/number_is_multiple_of_step/output.css +a { + b: 25px; +} + +<===> +================================================================================ +<===> strategy/nearest/upper_multiple/number_is_bigger/input.scss +a {b: round(nearest, 23px, 10px)} + +<===> strategy/nearest/upper_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/nearest/upper_multiple/number_is_smaller/input.scss +a {b: round(nearest, 18px, 10px)} + +<===> strategy/nearest/upper_multiple/number_is_smaller/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/nearest/upper_multiple/number_is_half/input.scss +a {b: round(nearest, 15px, 10px)} + +<===> strategy/nearest/upper_multiple/number_is_half/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/nearest/upper_multiple/number_is_negative/input.scss +a {b: round(nearest, -13px, 10px)} + +<===> strategy/nearest/upper_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> strategy/nearest/lower_multiple/number_is_bigger/input.scss +a {b: round(nearest, 13px, 10px)} + +<===> strategy/nearest/lower_multiple/number_is_bigger/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/nearest/lower_multiple/number_is_negative/input.scss +a {b: round(nearest, -18px, 10px)} + +<===> strategy/nearest/lower_multiple/number_is_negative/output.css +a { + b: -20px; +} diff --git a/spec/values/calculation/round/strategies/to-zero.hrx b/spec/values/calculation/round/strategies/to-zero.hrx new file mode 100644 index 000000000..bd6835f37 --- /dev/null +++ b/spec/values/calculation/round/strategies/to-zero.hrx @@ -0,0 +1,137 @@ +<===> README.md +Most of the same behavior tested for `calc()` applies to `round()`, but for +terseness' sake isn't tested explicitly. + +<===> +================================================================================ +<===> strategy/to-zero/positive/input.scss +a {b: round(to-zero, 120px, 25px)} + +<===> strategy/to-zero/positive/output.css +a { + b: 100px; +} + +<===> +================================================================================ +<===> strategy/to-zero/negative/input.scss +a {b: round(to-zero, -120px, -25px)} + +<===> strategy/to-zero/negative/output.css +a { + b: -125px; +} + +<===> +================================================================================ +<===> strategy/to-zero/upper_multiple/number_is_bigger/input.scss +a {b: round(to-zero, 23px, 10px)} + +<===> strategy/to-zero/upper_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/to-zero/upper_multiple/number_is_smaller/input.scss +a {b: round(to-zero, 18px, 10px)} + +<===> strategy/to-zero/upper_multiple/number_is_smaller/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/to-zero/upper_multiple/number_is_half/input.scss +a {b: round(to-zero, 15px, 10px)} + +<===> strategy/to-zero/upper_multiple/number_is_half/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/to-zero/upper_multiple/number_is_negative/input.scss +a {b: round(to-zero, -13px, 10px)} + +<===> strategy/to-zero/upper_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> strategy/to-zero/lower_multiple/number_is_bigger/input.scss +a {b: round(to-zero, 13px, 10px)} + +<===> strategy/to-zero/lower_multiple/number_is_bigger/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> strategy/to-zero/lower_multiple/number_is_negative/input.scss +a {b: round(to-zero, -18px, 10px)} + +<===> strategy/to-zero/lower_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> strategy/to-zero/negative_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(to-zero, -5, infinity))} + +<===> strategy/to-zero/negative_zero/positive_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/to-zero/negative_zero/negative_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(to-zero, -5, -infinity))} + +<===> strategy/to-zero/negative_zero/negative_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/to-zero/positive_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(to-zero, 5, infinity))} + +<===> strategy/to-zero/positive_zero/positive_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/to-zero/positive_zero/negative_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(to-zero, 5, -infinity))} + +<===> strategy/to-zero/positive_zero/negative_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/to-zero/nested_function/input.scss +a {b: round(to-zero, round(100, 10) * 2 - 95, 10)} + +<===> strategy/to-zero/nested_function/output.css +a { + b: 100; +} diff --git a/spec/values/calculation/round/strategies/up.hrx b/spec/values/calculation/round/strategies/up.hrx new file mode 100644 index 000000000..9c6c2e2d7 --- /dev/null +++ b/spec/values/calculation/round/strategies/up.hrx @@ -0,0 +1,197 @@ +<===> README.md +Most of the same behavior tested for `calc()` applies to `round()`, but for +terseness' sake isn't tested explicitly. + +<===> +================================================================================ +<===> strategy/up/positive/input.scss +a {b: round(up, 101px, 25px)} + +<===> strategy/up/positive/output.css +a { + b: 125px; +} + +<===> +================================================================================ +<===> strategy/up/step_is_multiple_of_number/input.scss +a {b: round(up, 5px, 25px)} + +<===> strategy/up/step_is_multiple_of_number/output.css +a { + b: 25px; +} + +<===> +================================================================================ +<===> strategy/up/number_is_multiple_of_step/input.scss +a {b: round(up, 25px, 5px)} + +<===> strategy/up/number_is_multiple_of_step/output.css +a { + b: 25px; +} + +<===> +================================================================================ +<===> strategy/up/negative/input.scss +a {b: round(up, -101, -25)} + +<===> strategy/up/negative/output.css +a { + b: -100; +} + +<===> +================================================================================ +<===> strategy/up/negative_step/input.scss +a {b: round(up, 12px, -7px)} + +<===> strategy/up/negative_step/output.css +a { + b: 14px; +} + +<===> +================================================================================ +<===> strategy/up/step_is_zero/input.scss +a {b: round(up, 10px, 0px)} + +<===> strategy/up/step_is_zero/output.css +a { + b: calc(NaN * 1px); +} + +<===> +================================================================================ +<===> strategy/up/positive_and_infinity/input.scss +a {b: round(up, 10, infinity)} + +<===> strategy/up/positive_and_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/up/negative_and_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(up, -10, infinity))} + +<===> strategy/up/negative_and_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/up/infinity/input.scss +@use "sass:math"; +a {b: round(up, infinity, infinity)} + +<===> strategy/up/infinity/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> strategy/up/upper_multiple/number_is_bigger/input.scss +a {b: round(up, 23px, 10px)} + +<===> strategy/up/upper_multiple/number_is_bigger/output.css +a { + b: 30px; +} + +<===> +================================================================================ +<===> strategy/up/upper_multiple/number_is_smaller/input.scss +a {b: round(up, 18px, 10px)} + +<===> strategy/up/upper_multiple/number_is_smaller/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/up/upper_multiple/number_is_half/input.scss +a {b: round(up, 15px, 10px)} + +<===> strategy/up/upper_multiple/number_is_half/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/up/upper_multiple/number_is_negative/input.scss +a {b: round(up, -13px, 10px)} + +<===> strategy/up/upper_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> strategy/up/lower_multiple/number_is_bigger/input.scss +a {b: round(up, 13px, 10px)} + +<===> strategy/up/lower_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> strategy/up/lower_multiple/number_is_negative/input.scss +a {b: round(up, -18px, 10px)} + +<===> strategy/up/lower_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> strategy/up/negative_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(up, -1 * 0, infinity))} + +<===> strategy/up/negative_zero/positive_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> strategy/up/positive_zero/zero/input.scss +@use "sass:math"; +a {b: math.div(1, round(up, 0, infinity))} + +<===> strategy/up/positive_zero/zero/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/up/positive_zero/one/input.scss +a {b: round(up, 1, infinity)} + +<===> strategy/up/positive_zero/one/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> strategy/up/nested_function/input.scss +a {b: round(up, round(100, 10) + 1, 10)} + +<===> strategy/up/nested_function/output.css +a { + b: 110; +} diff --git a/spec/values/calculation/round/three_arguments.hrx b/spec/values/calculation/round/three_arguments.hrx index 0e803f7d2..45579e68e 100644 --- a/spec/values/calculation/round/three_arguments.hrx +++ b/spec/values/calculation/round/three_arguments.hrx @@ -2,344 +2,6 @@ Most of the same behavior tested for `calc()` applies to `round()`, but for terseness' sake isn't tested explicitly. -<===> -================================================================================ -<===> strategy/nearest/simplification/input.scss -a { - b: round(nearest, 3.8px - 1px + var(--test), 1.1px + 4px)} - -<===> strategy/nearest/simplification/output.css -a { - b: round(nearest, 2.8px + var(--test), 5.1px); -} - -<===> -================================================================================ -<===> strategy/nearest/positive/input.scss -a {b: round(nearest, 117px, 25px)} - -<===> strategy/nearest/positive/output.css -a { - b: 125px; -} - -<===> -================================================================================ -<===> strategy/nearest/negative/input.scss -a {b: round(nearest, -101, -25)} - -<===> strategy/nearest/negative/output.css -a { - b: -100; -} - -<===> -================================================================================ -<===> strategy/nearest/negative_and_positive/input.scss -a {b: round(nearest, -10, 5)} - -<===> strategy/nearest/negative_and_positive/output.css -a { - b: -10; -} - -<===> -================================================================================ -<===> strategy/nearest/positive_and_negative/input.scss -a {b: round(nearest, 12px, -7px)} - -<===> strategy/nearest/positive_and_negative/output.css -a { - b: 14px; -} - -<===> -================================================================================ -<===> strategy/nearest/step_is_zero/input.scss -a {b: round(nearest, 10px, 0px)} - -<===> strategy/nearest/step_is_zero/output.css -a { - b: calc(NaN * 1px); -} - -<===> -================================================================================ -<===> strategy/nearest/positive_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(nearest, 10, infinity))} - -<===> strategy/nearest/positive_and_infinity/output.css -a { - b: calc(infinity); -} - -<===> -================================================================================ -<===> strategy/nearest/negative_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(nearest, -10, infinity))} - -<===> strategy/nearest/negative_and_infinity/output.css -a { - b: calc(-infinity); -} - -<===> -================================================================================ -<===> strategy/nearest/infinity/input.scss -@use "sass:math"; -a {b: round(nearest, infinity, infinity)} - -<===> strategy/nearest/infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> strategy/nearest/step_is_multiple_of_number/input.scss -a {b: round(nearest, 5px, 25px)} - -<===> strategy/nearest/step_is_multiple_of_number/output.css -a { - b: 0px; -} - -<===> -================================================================================ -<===> strategy/nearest/number_is_multiple_of_step/input.scss -a {b: round(nearest, 25px, 5px)} - -<===> strategy/nearest/number_is_multiple_of_step/output.css -a { - b: 25px; -} - -<===> -================================================================================ -<===> strategy/up/positive/input.scss -a {b: round(up, 101px, 25px)} - -<===> strategy/up/positive/output.css -a { - b: 125px; -} - -<===> -================================================================================ -<===> strategy/up/step_is_multiple_of_number/input.scss -a {b: round(up, 5px, 25px)} - -<===> strategy/up/step_is_multiple_of_number/output.css -a { - b: 25px; -} - -<===> -================================================================================ -<===> strategy/up/number_is_multiple_of_step/input.scss -a {b: round(up, 25px, 5px)} - -<===> strategy/up/number_is_multiple_of_step/output.css -a { - b: 25px; -} - -<===> -================================================================================ -<===> strategy/up/negative/input.scss -a {b: round(up, -101, -25)} - -<===> strategy/up/negative/output.css -a { - b: -100; -} - -<===> -================================================================================ -<===> strategy/up/negative_and_positive/input.scss -a {b: round(up, -10, 3)} - -<===> strategy/up/negative_and_positive/output.css -a { - b: -9; -} - -<===> -================================================================================ -<===> strategy/up/positive_and_negative/input.scss -a {b: round(up, 12px, -7px)} - -<===> strategy/up/positive_and_negative/output.css -a { - b: 14px; -} - -<===> -================================================================================ -<===> strategy/up/step_is_zero/input.scss -a {b: round(up, 10px, 0px)} - -<===> strategy/up/step_is_zero/output.css -a { - b: calc(NaN * 1px); -} - -<===> -================================================================================ -<===> strategy/up/positive_and_infinity/input.scss -a {b: round(up, 10, infinity)} - -<===> strategy/up/positive_and_infinity/output.css -a { - b: calc(infinity); -} - -<===> -================================================================================ -<===> strategy/up/negative_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(up, -10, infinity))} - -<===> strategy/up/negative_and_infinity/output.css -a { - b: calc(-infinity); -} - -<===> -================================================================================ -<===> strategy/up/infinity/input.scss -@use "sass:math"; -a {b: round(up, infinity, infinity)} - -<===> strategy/up/infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> strategy/down/step_is_multiple_of_number/input.scss -a {b: round(down, 5px, 25px)} - -<===> strategy/down/step_is_multiple_of_number/output.css -a { - b: 0px; -} - -<===> -================================================================================ -<===> strategy/down/number_is_multiple_of_step/input.scss -a {b: round(down, 25px, 5px)} - -<===> strategy/down/number_is_multiple_of_step/output.css -a { - b: 25px; -} - -<===> -================================================================================ -<===> strategy/down/positive/input.scss -a {b: round(down, 122px, 25px)} - -<===> strategy/down/positive/output.css -a { - b: 100px; -} - -<===> -================================================================================ -<===> strategy/down/negative/input.scss -a {b: round(down, -101, -25)} - -<===> strategy/down/negative/output.css -a { - b: -125; -} - -<===> -================================================================================ -<===> strategy/down/negative_and_positive/input.scss -a {b: round(down, -2, 7)} - -<===> strategy/down/negative_and_positive/output.css -a { - b: -7; -} - -<===> -================================================================================ -<===> strategy/down/positive_and_negative/input.scss -a {b: round(down, 12, -7)} - -<===> strategy/down/positive_and_negative/output.css -a { - b: 7; -} - -<===> -================================================================================ -<===> strategy/down/infinity/input.scss -a {b: round(down, infinity, infinity)} - -<===> strategy/down/infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> strategy/down/step_is_zero/input.scss -a {b: round(down, 10px, 0px)} - -<===> strategy/down/step_is_zero/output.css -a { - b: calc(NaN * 1px); -} - -<===> -================================================================================ -<===> strategy/down/positive_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(down, 10, infinity))} - -<===> strategy/down/positive_and_infinity/output.css -a { - b: calc(infinity); -} - -<===> -================================================================================ -<===> strategy/down/negative_and_infinity/input.scss -@use "sass:math"; -a {b: round(down, -10, infinity)} - -<===> strategy/down/negative_and_infinity/output.css -a { - b: calc(-infinity); -} - -<===> -================================================================================ -<===> strategy/to-zero/positive/input.scss -a {b: round(to-zero, 120px, 25px)} - -<===> strategy/to-zero/positive/output.css -a { - b: 100px; -} - -<===> -================================================================================ -<===> strategy/to-zero/negative/input.scss -a {b: round(to-zero, -120px, 25px)} - -<===> strategy/to-zero/negative/output.css -a { - b: -100px; -} - <===> ================================================================================ <===> strategy/unknown_variable/input.scss diff --git a/spec/values/calculation/round/two_arguments.hrx b/spec/values/calculation/round/two_arguments.hrx index c999f79f5..a9b4f6a0b 100644 --- a/spec/values/calculation/round/two_arguments.hrx +++ b/spec/values/calculation/round/two_arguments.hrx @@ -92,34 +92,32 @@ a { <===> ================================================================================ -<===> step/zero/input.scss +<===> step_is_zero/input.scss a {b: round(5px, 0px)} -<===> step/zero/output.css +<===> step_is_zero/output.css a { b: calc(NaN * 1px); } <===> ================================================================================ -<===> step/negative_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(-0, infinity))} +<===> equals/input.scss +a {b: round(10px, 10px)} -<===> step/negative_and_infinity/output.css +<===> equals/output.css a { - b: calc(-infinity); + b: 10px; } <===> ================================================================================ -<===> step/positive_and_infinity/input.scss -@use "sass:math"; -a {b: math.div(1, round(0, infinity))} +<===> nested_function/input.scss +a {b: round(round(100, 10), 10)} -<===> step/positive_and_infinity/output.css +<===> nested_function/output.css a { - b: calc(infinity); + b: 100; } <===> @@ -134,10 +132,70 @@ a { <===> ================================================================================ -<===> infinity/input.scss +<===> infinity_and_positive/input.scss +a {b: round(infinity, 5)} + +<===> infinity_and_positive/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> negative_infinity_and_negative/input.scss +a {b: round(-infinity, -5)} + +<===> negative_infinity_and_negative/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> negative_infinity_and_positive/input.scss +a {b: round(-infinity, 5)} + +<===> negative_infinity_and_positive/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> infinity/positive/input.scss a {b: round(infinity, infinity)} -<===> infinity/output.css +<===> infinity/positive/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> infinity/negative/input.scss +a {b: round(-infinity, -infinity)} + +<===> infinity/negative/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> infinity/negative_and_positive/input.scss +a {b: round(-infinity, infinity)} + +<===> infinity/negative_and_positive/output.css +a { + b: calc(NaN); +} + +<===> +================================================================================ +<===> infinity/positive_and_negative/input.scss +a {b: round(infinity, -infinity)} + +<===> infinity/positive_and_negative/output.css a { b: calc(NaN); } @@ -175,3 +233,179 @@ a { a { e: round(5.5px, 1px); } + +<===> +================================================================================ +<===> upper_multiple/number_is_bigger/input.scss +a {b: round(23px, 10px)} + +<===> upper_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> upper_multiple/number_is_smaller/input.scss +a {b: round(18px, 10px)} + +<===> upper_multiple/number_is_smaller/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> upper_multiple/number_is_half/input.scss +a {b: round(15px, 10px)} + +<===> upper_multiple/number_is_half/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> upper_multiple/number_is_negative/input.scss +a {b: round(-13px, 10px)} + +<===> upper_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> lower_multiple/number_is_bigger/input.scss +a {b: round(13px, 10px)} + +<===> lower_multiple/number_is_bigger/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> lower_multiple/number_is_negative/input.scss +a {b: round(-18px, 10px)} + +<===> lower_multiple/number_is_negative/output.css +a { + b: -20px; +} + +<===> +================================================================================ +<===> negative_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(-5, infinity))} + +<===> negative_zero/positive_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> negative_zero/negative_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(-5, -infinity))} + +<===> negative_zero/negative_infinity/output.css +a { + b: calc(-infinity); +} + +<===> +================================================================================ +<===> positive_zero/positive_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(5, infinity))} + +<===> positive_zero/positive_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> positive_zero/negative_infinity/input.scss +@use "sass:math"; +a {b: math.div(1, round(5, -infinity))} + +<===> positive_zero/negative_infinity/output.css +a { + b: calc(infinity); +} + +<===> +================================================================================ +<===> negative_step/upper_multiple/number_is_bigger/input.scss +a {b: round(23px, -10px)} + +<===> negative_step/upper_multiple/number_is_bigger/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> negative_step/upper_multiple/number_is_smaller/input.scss +a {b: round(18px, -10px)} + +<===> negative_step/upper_multiple/number_is_smaller/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> negative_step/upper_multiple/number_is_half/input.scss +a {b: round(15px, -10px)} + +<===> negative_step/upper_multiple/number_is_half/output.css +a { + b: 20px; +} + +<===> +================================================================================ +<===> negative_step/upper_multiple/number_is_negative/input.scss +a {b: round(-13px, -10px)} + +<===> negative_step/upper_multiple/number_is_negative/output.css +a { + b: -10px; +} + +<===> +================================================================================ +<===> negative_step/lower_multiple/number_is_bigger/input.scss +a {b: round(13px, -10px)} + +<===> negative_step/lower_multiple/number_is_bigger/output.css +a { + b: 10px; +} + +<===> +================================================================================ +<===> negative_step/lower_multiple/number_is_negative/input.scss +a {b: round(-18px, -10px)} + +<===> negative_step/lower_multiple/number_is_negative/output.css +a { + b: -20px; +} + +<===> +================================================================================ +<===> math/unknown_units/input.scss +a { + b: round(1px + 0%, 1px + 0%); +} + +<===> math/unknown_units/output.css +a { + b: round(1px + 0%, 1px + 0%); +}