Skip to content

Unnecessary whitespaces in test stdout capture #50362

Closed
@Vlad-Shcherbina

Description

@Vlad-Shcherbina

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

Activity

ehuss

ehuss commented on May 1, 2018

@ehuss
Contributor

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

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
A-libtestArea: `#[test]` / the `test` library
on May 1, 2018
phansch

phansch commented on May 2, 2018

@phansch
Member

Going to take a look at this 👍

added a commit that references this issue on May 14, 2018

Rollup merge of rust-lang#50387 - phansch:remove_leftover_tab, r=alex…

3acea17
added a commit that references this issue on May 17, 2018

Rollup merge of rust-lang#50387 - phansch:remove_leftover_tab, r=alex…

6e95b87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ehuss@Vlad-Shcherbina@phansch@pietroalbini

        Issue actions

          Unnecessary whitespaces in test stdout capture · Issue #50362 · rust-lang/rust