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

Function test_diagnostics_with_string

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

Source from the content-addressed store, hash-verified

94
95#[test]
96fn test_diagnostics_with_string() {
97 let bump = Bump::new();
98 let source = r#"
99 style-rule {
100 level: warning;
101 diagnostic: "Found a style rule";
102 }
103 "#;
104 let css_source = ".foo {} .bar {}";
105
106 let (_, diagnostics) = run(&bump, source, css_source);
107 assert_eq!(diagnostics.len(), 2);
108 assert_eq!(diagnostics[0].message, "Found a style rule");
109 assert_eq!(diagnostics[0].severity, ResolvedDiagnosticLevel::Warning);
110 assert_eq!(diagnostics[1].message, "Found a style rule");
111 assert_eq!(diagnostics[1].severity, ResolvedDiagnosticLevel::Warning);
112}
113
114#[test]
115fn test_diagnostics_with_attr() {

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected