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

Function test_diagnostics_with_attr

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

Source from the content-addressed store, hash-verified

113
114#[test]
115fn test_diagnostics_with_attr() {
116 let bump = Bump::new();
117 let source = r#"
118 [name] {
119 level: error;
120 diagnostic: "Property " attr(name) " found";
121 }
122 "#;
123 let css_source = ".foo { color: red; margin: 0; }";
124
125 let (_, diagnostics) = run(&bump, source, css_source);
126 assert_eq!(diagnostics.len(), 2);
127 assert_eq!(diagnostics[0].message, "Property color found");
128 assert_eq!(diagnostics[0].severity, ResolvedDiagnosticLevel::Error);
129 assert_eq!(diagnostics[1].message, "Property margin found");
130 assert_eq!(diagnostics[1].severity, ResolvedDiagnosticLevel::Error);
131}
132
133#[test]
134fn test_diagnostics_with_size() {

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected