| 94 | |
| 95 | #[test] |
| 96 | fn 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] |
| 115 | fn test_diagnostics_with_attr() { |