MCPcopy Create free account
hub / github.com/csskit/csskit / test_when_rule_false_condition

Function test_when_rule_false_condition

crates/csskit_ast/src/collector/tests.rs:216–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215#[test]
216fn test_when_rule_false_condition() {
217 let bump = Bump::new();
218 let source = r#"
219 style-rule { collect: --rules; }
220 @when (--rules > 10) {
221 level: error;
222 diagnostic: "Too many rules";
223 }
224 "#;
225 let css_source = ".a {} .b {}";
226
227 let (counters, diagnostics) = run(&bump, source, css_source);
228 let a = CsskitAtomSet::get_dyn_set().atom_from_str("rules");
229 assert_eq!(counters.get(&a), Some(&(StatType::Counter, 2)));
230 assert_eq!(diagnostics.len(), 0);
231}
232
233#[test]
234fn test_when_rule_with_nested_selector() {

Callers

nothing calls this directly

Calls 2

atom_from_strMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected