Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
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 |
fn style_01() { |
| 31 |
assert_eq!( |
| 32 |
run_process("> {}"), |
| 33 |
"WARN: Selector parsing failed cause unexpected combinator.\n" |
| 34 |
); |
| 35 |
} |
| 36 |
|
| 37 |
#[test] |
| 38 |
fn style_02() { |
| 39 |
assert_eq!( |
| 40 |
run_process("@import 'subs.css';"), |
| 41 |
"WARN: The @import rule is not supported. Skipped.\n" |
| 42 |
); |
| 43 |
} |