-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of deprecation stuff that I don't yet have the infrastructure to support properly.
- Loading branch information
Showing
72 changed files
with
1,900 additions
and
647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
rsass/tests/spec/core_functions/color/adjust_hue/above_max.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Tests auto-converted from "sass-spec/spec/core_functions/color/adjust_hue/above_max.hrx" | ||
#[allow(unused)] | ||
fn runner() -> crate::TestRunner { | ||
super::runner().with_cwd("above_max") | ||
} | ||
|
||
#[test] | ||
fn test() { | ||
assert_eq!( | ||
runner().ok("a {b: adjust-hue(red, 540)}\n"), | ||
"a {\ | ||
\n b: aqua;\ | ||
\n}\n" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Tests auto-converted from "sass-spec/spec/core_functions/color/adjust_hue/alpha.hrx" | ||
#[allow(unused)] | ||
fn runner() -> crate::TestRunner { | ||
super::runner().with_cwd("alpha") | ||
} | ||
|
||
#[test] | ||
fn test() { | ||
assert_eq!( | ||
runner().ok("a {b: adjust-hue(rgba(red, 0.1), 359)}\n"), | ||
"a {\ | ||
\n b: rgba(255, 0, 4.25, 0.1);\ | ||
\n}\n" | ||
); | ||
} |
113 changes: 113 additions & 0 deletions
113
rsass/tests/spec/core_functions/color/adjust_hue/error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
//! Tests auto-converted from "sass-spec/spec/core_functions/color/adjust_hue/error.hrx" | ||
#[allow(unused)] | ||
fn runner() -> crate::TestRunner { | ||
super::runner().with_cwd("error") | ||
} | ||
|
||
#[test] | ||
#[ignore] // wrong error | ||
fn non_legacy() { | ||
assert_eq!( | ||
runner().err( | ||
"a {b: adjust-hue(lch(0% 0 0deg), 10deg)}\n" | ||
), | ||
"DEPRECATION WARNING: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.\ | ||
\nUse color.adjust instead.\n\ | ||
\nMore info and automated migrator: https://sass-lang.com/d/import\n\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(lch(0% 0 0deg), 10deg)}\ | ||
\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet\n\ | ||
\nError: adjust-hue() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument.\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(lch(0% 0 0deg), 10deg)}\ | ||
\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet", | ||
); | ||
} | ||
#[test] | ||
fn too_few_args() { | ||
assert_eq!( | ||
runner().err("a {b: adjust-hue(red)}\n"), | ||
"Error: Missing argument $degrees.\ | ||
\n ,--> input.scss\ | ||
\n1 | a {b: adjust-hue(red)}\ | ||
\n | ^^^^^^^^^^^^^^^ invocation\ | ||
\n \'\ | ||
\n ,--> sass:color\ | ||
\n1 | @function adjust-hue($color, $degrees) {\ | ||
\n | ============================ declaration\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet", | ||
); | ||
} | ||
#[test] | ||
fn too_many_args() { | ||
assert_eq!( | ||
runner().err("a {b: adjust-hue(red, 1, 2)}\n"), | ||
"Error: Only 2 arguments allowed, but 3 were passed.\ | ||
\n ,--> input.scss\ | ||
\n1 | a {b: adjust-hue(red, 1, 2)}\ | ||
\n | ^^^^^^^^^^^^^^^^^^^^^ invocation\ | ||
\n \'\ | ||
\n ,--> sass:color\ | ||
\n1 | @function adjust-hue($color, $degrees) {\ | ||
\n | ============================ declaration\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet", | ||
); | ||
} | ||
mod test_type { | ||
#[allow(unused)] | ||
use super::runner; | ||
|
||
#[test] | ||
#[ignore] // wrong error | ||
fn color() { | ||
assert_eq!( | ||
runner().err( | ||
"a {b: adjust-hue(1, 2)}\n" | ||
), | ||
"DEPRECATION WARNING: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.\ | ||
\nUse color.adjust instead.\n\ | ||
\nMore info and automated migrator: https://sass-lang.com/d/import\n\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(1, 2)}\ | ||
\n | ^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet\n\ | ||
\nError: $color: 1 is not a color.\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(1, 2)}\ | ||
\n | ^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet", | ||
); | ||
} | ||
#[test] | ||
#[ignore] // wrong error | ||
fn hue() { | ||
assert_eq!( | ||
runner().err( | ||
"a {b: adjust-hue(red, blue)}\n" | ||
), | ||
"DEPRECATION WARNING: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.\ | ||
\nUse color.adjust instead.\n\ | ||
\nMore info and automated migrator: https://sass-lang.com/d/import\n\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(red, blue)}\ | ||
\n | ^^^^^^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet\n\ | ||
\nError: $degrees: blue is not a number.\ | ||
\n ,\ | ||
\n1 | a {b: adjust-hue(red, blue)}\ | ||
\n | ^^^^^^^^^^^^^^^^^^^^^\ | ||
\n \'\ | ||
\n input.scss 1:7 root stylesheet", | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
rsass/tests/spec/core_functions/color/adjust_hue/fraction.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Tests auto-converted from "sass-spec/spec/core_functions/color/adjust_hue/fraction.hrx" | ||
#[allow(unused)] | ||
fn runner() -> crate::TestRunner { | ||
super::runner().with_cwd("fraction") | ||
} | ||
|
||
#[test] | ||
fn test() { | ||
assert_eq!( | ||
runner().ok("a {b: adjust-hue(red, 0.5)}\n"), | ||
"a {\ | ||
\n b: rgb(255, 2.125, 0);\ | ||
\n}\n" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Tests auto-converted from "sass-spec/spec/core_functions/color/adjust_hue/max.hrx" | ||
#[allow(unused)] | ||
fn runner() -> crate::TestRunner { | ||
super::runner().with_cwd("max") | ||
} | ||
|
||
#[test] | ||
fn test() { | ||
assert_eq!( | ||
runner().ok("a {b: adjust-hue(red, 359)}\n"), | ||
"a {\ | ||
\n b: rgb(255, 0, 4.25);\ | ||
\n}\n" | ||
); | ||
} |
Oops, something went wrong.