8000 `expect!` test fails after update · Issue #55 · rust-analyzer/expect-test · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

expect! test fails after update #55

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

Open
lijunchen opened this issue Apr 23, 2025 · 0 comments
Open

expect! test fails after update #55

lijunchen opened this issue Apr 23, 2025 · 0 comments

Comments

@lijunchen
Copy link

My env:

$ rustc --version                
rustc 1.86.0 (05f9846f8 2025-03-31)
$ cat Cargo.toml         
...
[dev-dependencies]
expect-test = "1.5.1"

Here is a mini test case to reproduce:

#[test]
fn expect_test_bug() {
    use expect_test::expect;
    expect![].assert_eq("X\n    Y\n    \nZ");
}

After run

$ env UPDATE_EXPECT=1 cargo test

This test block will be updated to

#[test]
fn expect_test_bug() {
    use expect_test::expect;
    expect![[r#"
        X
            Y
    
        Z"#]].assert_eq("X\n    Y\n    \nZ");
}

Then run cargo test, it fails because missing four spaces between Y and Z in Expect

$ cargo test
Expect:
----
X
    Y

Z
----

Actual:
----
X
    Y
    
Z
----

Diff:
----
X
    Y
    
Z
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant
0