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

Function test_implicit_counter

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

Source from the content-addressed store, hash-verified

44
45#[test]
46fn test_implicit_counter() {
47 let bump = Bump::new();
48 let source = r#"
49 style-rule { collect: --total-rules; }
50 "#;
51 let css_source = r#"
52 .foo {}
53 #bar {}
54 .baz {}
55 "#;
56 let (counters, diagnostics) = run(&bump, source, css_source);
57 let a = CsskitAtomSet::get_dyn_set().atom_from_str("total-rules");
58 assert_eq!(counters.get(&a), Some(&(StatType::Counter, 3)));
59 assert_eq!(diagnostics.len(), 0, "No diagnostics should be generated");
60}
61
62#[test]
63fn test_bytes() {

Callers

nothing calls this directly

Calls 2

atom_from_strMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected