tests: prepare to the glob & clean a bit
This commit is contained in:
parent
69a71ed9a7
commit
74c32ec1f9
11 changed files with 73 additions and 13 deletions
31
tests/assets/global.scss
Normal file
31
tests/assets/global.scss
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
use sabry::styly;
|
|
||||||
|
|
||||||
pub mod sass {
|
pub mod sass {
|
||||||
use sabry::scssy;
|
use sabry::scssy;
|
||||||
|
|
||||||
|
|
@ -76,15 +74,6 @@ pub mod scss {
|
||||||
pub(crate) use module_scss as module_c;
|
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]
|
#[test]
|
||||||
fn ensure_inline_matches_file() {
|
fn ensure_inline_matches_file() {
|
||||||
assert_eq!(sass::mixins_a!(), sass::mixins_inline_a!());
|
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
|
|
@ -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}
|
||||||
|
|
@ -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
3
tests/styly_global.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
use sabry::styly;
|
||||||
|
|
||||||
|
styly!(global_scss:scss "tests/assets/global.scss");
|
||||||
4
tests/styly_module_usage.rs
Normal file
4
tests/styly_module_usage.rs
Normal 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");
|
||||||
4
tests/styly_repeating_selector.rs
Normal file
4
tests/styly_repeating_selector.rs
Normal 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
4
tests/styly_sole_code.rs
Normal 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");
|
||||||
4
tests/styly_use_forwarded.rs
Normal file
4
tests/styly_use_forwarded.rs
Normal 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");
|
||||||
Loading…
Reference in a new issue