Sha256: 2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989

Contents?: true

Size: 1.07 KB

Versions: 52

Compression:

Stored size: 1.07 KB

Contents

#![cfg(syn_disable_nightly_tests)]

use std::io::{self, Write};
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};

const MSG: &str = "\
‖
‖   WARNING:
‖   This is not a nightly compiler so not all tests were able to
‖   run. Syn includes tests that compare Syn's parser against the
‖   compiler's parser, which requires access to unstable librustc
‖   data structures and a nightly compiler.
‖
";

#[test]
fn notice() -> io::Result<()> {
    let header = "WARNING";
    let index_of_header = MSG.find(header).unwrap();
    let before = &MSG[..index_of_header];
    let after = &MSG[index_of_header + header.len()..];

    let mut stderr = StandardStream::stderr(ColorChoice::Auto);
    stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?;
    write!(&mut stderr, "{}", before)?;
    stderr.set_color(ColorSpec::new().set_bold(true).set_fg(Some(Color::Yellow)))?;
    write!(&mut stderr, "{}", header)?;
    stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?;
    write!(&mut stderr, "{}", after)?;
    stderr.reset()?;

    Ok(())
}

Version data entries

52 entries across 38 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/syn-2.0.96/tests/zzz_stable.rs
wasmtime-28.0.0 ./ext/cargo-vendor/syn-2.0.95/tests/zzz_stable.rs
wasmtime-27.0.0 ./ext/cargo-vendor/syn-2.0.89/tests/zzz_stable.rs
wasmtime-26.0.0 ./ext/cargo-vendor/syn-2.0.85/tests/zzz_stable.rs
wasmtime-25.0.2 ./ext/cargo-vendor/syn-2.0.75/tests/zzz_stable.rs
wasmtime-25.0.1 ./ext/cargo-vendor/syn-2.0.75/tests/zzz_stable.rs
wasmtime-25.0.0 ./ext/cargo-vendor/syn-2.0.75/tests/zzz_stable.rs
wasmtime-24.0.0 ./ext/cargo-vendor/syn-2.0.75/tests/zzz_stable.rs
wasmtime-23.0.2 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-22.0.0 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-21.0.1 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-20.0.2 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-20.0.0 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-18.0.3 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-17.0.1 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-17.0.0 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-16.0.0 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-15.0.1 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-15.0.0 ./ext/cargo-vendor/syn-2.0.48/tests/zzz_stable.rs
wasmtime-14.0.4 ./ext/cargo-vendor/syn-1.0.109/tests/zzz_stable.rs