| 1 |
// Copyright 2019 the SimpleCSS Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 OR MIT |
| 3 |
|
| 4 |
//! Warnings |
| 5 |
|
| 6 |
fn run_processrust-analyzer cargo simplecss 0.2.2 run_process().(input: &str) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 7 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#; |
| 8 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::processrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/::Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#; |
| 9 |
|
| 10 |
let mut child = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::processrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/::Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]new().("target/debug/examples/parse") |
| 11 |
.argrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]arg().("-") |
| 12 |
.stdinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]stdin().(Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#::pipedrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Stdio]piped().()) |
| 13 |
.stdoutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]stdout().(Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#::nullrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Stdio]null().()) |
| 14 |
.stderrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]stderr().(Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#::pipedrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Stdio]piped().()) |
| 15 |
.spawnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]spawn().() |
| 16 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 17 |
|
| 18 |
child |
| 19 |
.stdinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Child#stdin. |
| 20 |
.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_mut().() |
| 21 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().() |
| 22 |
.write_allrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#write_all().(input.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()) |
| 23 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 24 |
|
| 25 |
let output = child.wait_with_outputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Child]wait_with_output().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to read stdout"); |
| 26 |
Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8().(output.stderrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#stderr.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 27 |
} |
| 28 |
|
| 29 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •30 |
#[ignore] |
| 31 |
fn style_01rust-analyzer cargo simplecss 0.2.2 style_01().() { |
| 32 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 33 |
run_processrust-analyzer cargo simplecss 0.2.2 run_process().("> {}"), |
| 34 |
"WARN: Selector parsing failed cause unexpected combinator.\n" |
| 35 |
); |
| 36 |
} |
| 37 |
|
| 38 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •39 |
#[ignore] |
| 40 |
fn style_02rust-analyzer cargo simplecss 0.2.2 style_02().() { |
| 41 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 42 |
run_processrust-analyzer cargo simplecss 0.2.2 run_process().("@import 'subs.css';"), |
| 43 |
"WARN: The @import rule is not supported. Skipped.\n" |
| 44 |
); |
| 45 |
} |