Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary whitespaces in test stdout capture #50362

Closed
Vlad-Shcherbina opened this issue May 1, 2018 · 2 comments
Closed

Unnecessary whitespaces in test stdout capture #50362

Vlad-Shcherbina opened this issue May 1, 2018 · 2 comments
Labels
A-libtest Area: #[test] related C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@Vlad-Shcherbina
Copy link

To reproduce, run cargo test on the following library:

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        println!("hello");
        println!("world");
        panic!();
    }
}

Expected output:

...
---- tests::it_works stdout ----
hello
world
thread 'tests::it_works' panicked at 'explicit panic', src\lib.rs:7:9
...

Actual output:

...
---- tests::it_works stdout ----
        hello
world
thread 'tests::it_works' panicked at 'explicit panic', src\lib.rs:7:9
...

Version info:

> rustc --version --verbose
rustc 1.26.0-nightly (5508b2714 2018-03-18)
binary: rustc
commit-hash: 5508b27145cfb82896ae838e6aca0cd48750796f
commit-date: 2018-03-18
host: x86_64-pc-windows-msvc
release: 1.26.0-nightly
LLVM version: 6.0

> cargo --version --verbose
cargo 1.26.0-nightly (d6c3983fe 2018-03-16)
release: 1.26.0
commit-hash: d6c3983fe3bd8fa06b54712e53fb23645598188b
commit-date: 2018-03-16
@ehuss
Copy link
Contributor

ehuss commented May 1, 2018

It looks like the indentation was removed in #19299, but the \t was left behind for the first line.

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-libtest Area: #[test] related labels May 1, 2018
@phansch
Copy link
Member

phansch commented May 2, 2018

Going to take a look at this 👍

phansch added a commit to phansch/rust that referenced this issue May 2, 2018
kennytm added a commit to kennytm/rust that referenced this issue May 14, 2018
…crichton

Remove leftover tab in libtest outputs

This removes some tabs that were present in the output of libtest.

Related rust-lang#19299
Closes rust-lang#50362
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 17, 2018
…crichton

Remove leftover tab in libtest outputs

This removes some tabs that were present in the output of libtest.

Related rust-lang#19299
Closes rust-lang#50362
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: #[test] related C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

4 participants