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

Can the line after a ... contain [..]? #216

Closed
smoelius opened this issue Jun 12, 2023 · 3 comments
Closed

Can the line after a ... contain [..]? #216

smoelius opened this issue Jun 12, 2023 · 3 comments
Labels
A-snapbox Area: snapbox package enhancement Improve the expected

Comments

@smoelius
Copy link
Contributor

Part of my test's expected stdout looks like this (note the ... and the [..]):

stderr=```
...
     Running tests/a.rs (examples/failure/target/debug/deps/a-[..])
error: test failed, to rerun pass `--test a`
```

When I run the test, the actual stdout doesn't match, and I see this in the diff:

  24      - ...
  25      -      Running tests/a.rs (examples/failure/target/debug/deps/a-[..])
       24 +     Finished test [unoptimized + debuginfo] target(s) in 0.00s
       25 +      Running tests/a.rs (examples/failure/target/debug/deps/a-ba92ccadfb1a363b)

The above looks odd to me, because I would expect the ... to match the Finished line.

If I remove the Running line from the expected stdout, the test passes (i.e., the ... matches both the Finished and Running lines).

This suggests to me that the line after a ... cannot contain a [..](?).

Is this correct, and if so, is it expected behavior?

@smoelius smoelius changed the title Can the line after a ... contain [...]? Can the line after a ... contain [..]? Jun 12, 2023
@epage epage added enhancement Improve the expected A-trycmd labels Jun 12, 2023
@epage
Copy link
Contributor

epage commented Jun 12, 2023

At this time, the matcher needs a literal line after ... to correctly find when the end is. I have run into this limitation myself and would love to loosen it. However, the code is quite complex, handling a lot of corner cases, so I have not tried to take this on myself but if someone else makes an attempt that is reasonably understandable, I think I'd be open to merging (we'd have to see what trade offs exist, I haven't touched this area in a while)

@smoelius
Copy link
Contributor Author

Thank you very much for the prompt response!

@settings settings bot removed A-snapbox labels Aug 14, 2023
@epage epage added the A-snapbox Area: snapbox package label Aug 15, 2023
@epage
Copy link
Contributor

epage commented Apr 20, 2024

Fixed in #279

@epage epage closed this as completed Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-snapbox Area: snapbox package enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants