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

Function test_basic

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

Source from the content-addressed store, hash-verified

26
27#[test]
28fn test_basic() {
29 let bump = Bump::new();
30 let source = r#"
31 @stat --total-rules { type: counter; }
32 style-rule { collect: --total-rules; }
33 "#;
34 let css_source = r#"
35 .foo {}
36 #bar {}
37 .baz {}
38 "#;
39 let (counters, diagnostics) = run(&bump, source, css_source);
40 let a = CsskitAtomSet::get_dyn_set().atom_from_str("total-rules");
41 assert_eq!(counters.get(&a), Some(&(StatType::Counter, 3)));
42 assert_eq!(diagnostics.len(), 0, "No diagnostics should be generated");
43}
44
45#[test]
46fn test_implicit_counter() {

Callers

nothing calls this directly

Calls 2

atom_from_strMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected