tests: prepare to the glob & clean a bit

This commit is contained in:
yiffyrusdev 2024-12-13 10:33:59 +05:00 • committed by spushk
commit 74c32ec1f9
Signed by: spushk
GPG key ID: 7797B761E105E8AA
11 changed files with 73 additions and 13 deletions

31
tests/assets/global.scss Normal file
View file

@ -0,0 +1,31 @@
.p1 {
font-size: 10px;
color: white;
&-dark {
color: black;
}
:global(html.mob) & {
font-size: 1rem;
&-dark {
color: green;
}
:global(ie) some & {
border: 1px;
}
}
:global(html.dark) & {
color: orange;
}
:global(whatever) & {
background: yellow;
:global(ooops) & {
border: none;
}
}
}

View file

@ -1,5 +1,3 @@
use sabry::styly;
pub mod sass {
use sabry::scssy;
@ -76,15 +74,6 @@ pub mod scss {
pub(crate) use module_scss as module_c;
}
styly!(sole_code_sass:sass "tests/assets/sole-code.sass");
styly!(sole_code_scss:scss "tests/assets/sole-code.scss");
styly!(module_usage_sass:sass "tests/assets/module-usage.sass");
styly!(module_usage_scss:scss "tests/assets/module-usage.scss");
styly!(use_forwarded_sass:sass "tests/assets/use-forwarded.sass");
styly!(use_forwarded_scss:scss "tests/assets/use-forwarded.scss");
styly!(repeating_selector_sass:sass "tests/assets/repeating-selector.sass");
styly!(repeating_selector_scss:scss "tests/assets/repeating-selector.scss");
#[test]
fn ensure_inline_matches_file() {
assert_eq!(sass::mixins_a!(), sass::mixins_inline_a!());

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
---
source: tests/macros.rs
assertion_line: 184
input_file: tests/sabry_output/scopes/global_scss.css
snapshot_kind: text
---
.qbRV6eFWg6fUikzGqcGvZg.p1{color:#fff;font-size:10px}.qbRV6eFWg6fUikzGqcGvZg.p1-dark{color:#000}html.mob .qbRV6eFWg6fUikzGqcGvZg.p1{font-size:1rem}html.mob .qbRV6eFWg6fUikzGqcGvZg.p1-dark{color:green}html.dark .qbRV6eFWg6fUikzGqcGvZg.p1{color:purple}whatever .qbRV6eFWg6fUikzGqcGvZg.p1{background:#ff0}

View file

@ -0,0 +1,7 @@
---
source: tests/macros.rs
assertion_line: 172
input_file: tests/sabry_output/scopes/global_scss.css
snapshot_kind: text
---
.wZIQboPSLZ8aKu0MjXHwYg.p1{color:#fff;font-size:10px}.wZIQboPSLZ8aKu0MjXHwYg.p1-dark{color:#000}html.mob .wZIQboPSLZ8aKu0MjXHwYg.p1{font-size:1rem}html.mob .wZIQboPSLZ8aKu0MjXHwYg.p1-dark{color:green}ie some.wZIQboPSLZ8aKu0MjXHwYg html.mob .wZIQboPSLZ8aKu0MjXHwYg.p1{border:1px}html.dark .wZIQboPSLZ8aKu0MjXHwYg.p1{color:orange}whatever .wZIQboPSLZ8aKu0MjXHwYg.p1{background:#ff0}ooops whatever .wZIQboPSLZ8aKu0MjXHwYg.p1{border:none}

3
tests/styly_global.rs Normal file
View file

@ -0,0 +1,3 @@
use sabry::styly;
styly!(global_scss:scss "tests/assets/global.scss");

View file

@ -0,0 +1,4 @@
use sabry::styly;
styly!(module_usage_sass:sass "tests/assets/module-usage.sass");
styly!(module_usage_scss:scss "tests/assets/module-usage.scss");

View file

@ -0,0 +1,4 @@
use sabry::styly;
styly!(repeating_selector_sass:sass "tests/assets/repeating-selector.sass");
styly!(repeating_selector_scss:scss "tests/assets/repeating-selector.scss");

4
tests/styly_sole_code.rs Normal file
View file

@ -0,0 +1,4 @@
use sabry::styly;
styly!(sole_code_sass:sass "tests/assets/sole-code.sass");
styly!(sole_code_scss:scss "tests/assets/sole-code.scss");

View file

@ -0,0 +1,4 @@
use sabry::styly;
styly!(use_forwarded_sass:sass "tests/assets/use-forwarded.sass");
styly!(use_forwarded_scss:scss "tests/assets/use-forwarded.scss");