Debian Codegraph @

tests/warnings.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 // Copyright 2019 the SimpleCSS Authors
2 // SPDX-License-Identifier: Apache-2.0 OR MIT
3
4 //! Warnings
5
6 fn run_process(input: &str) -> String {
7 use std::io::Write;
8 use std::process::Stdio;
9
10 let mut child = std::process::Command::new("target/debug/examples/parse")
11 .arg("-")
12 .stdin(Stdio::piped())
13 .stdout(Stdio::null())
14 .stderr(Stdio::piped())
15 .spawn()
16 .unwrap();
17
18 child
19 .stdin
20 .as_mut()
21 .unwrap()
22 .write_all(input.as_bytes())
23 .unwrap();
24
25 let output = child.wait_with_output().expect("Failed to read stdout");
26 String::from_utf8(output.stderr).unwrap()
27 }
28
29 #[test]
•30 #[ignore]
31 fn style_01() {
32 assert_eq!(
33 run_process("> {}"),
34 "WARN: Selector parsing failed cause unexpected combinator.\n"
35 );
36 }
37
38 #[test]
•39 #[ignore]
40 fn style_02() {
41 assert_eq!(
42 run_process("@import 'subs.css';"),
43 "WARN: The @import rule is not supported. Skipped.\n"
44 );
45 }