Skip to content

Substitute vars in tests #11

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

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

9999years
Copy link
Contributor

  1. Substitute the path variables used in the tests. This makes the tests a lot easier to read, because I don't need to do the substitution in my head.
  2. Add some doctests for relative paths, because it wasn't clear from reading the docs what the behavior would be.

Having to check exactly what path `bar` and `quux` refer to when reading
the tests makes it challenging to use them as a reference for behavior.
@Manishearth Manishearth merged commit da05c66 into Manishearth:master Jun 12, 2024
1 of 2 checks passed
@Manishearth
Copy link
Owner

Oops, should have waited for all CI to pass

---- src\lib.rs - diff_paths (line 18) stdout ----
Test executable failed (exit code: 101).

stderr:
thread 'main' panicked at src\lib.rs:16:1:
assertion `left == right` failed
  left: Some("..\\..\\..\\baz")
 right: None
stack backtrace:
   0:     0x7ff6b7cbdc2a - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:99
   1:     0x7ff6b7cbdc2a - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff6b7cbdc2a - std::sys_common::backtrace::_print_fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:68
   3:     0x7ff6b7cbdc2a - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:44
   4:     0x7ff6b7ccb8fb - core::fmt::rt::Argument::fmt
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\fmt\rt.rs:142
   5:     0x7ff6b7ccb8fb - core::fmt::write
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\fmt\mod.rs:1153
   6:     0x7ff6b7cbaf91 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\io\mod.rs:1843
   7:     0x7ff6b7cbda16 - std::sys_common::backtrace::print
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\sys_common\backtrace.rs:[34](https://github.com/Manishearth/pathdiff/actions/runs/9490348669/job/26155430777#step:4:35)
   8:     0x7ff6b7cbfaaf - std::panicking::default_hook::closure$1
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:272

@Manishearth
Copy link
Owner

Opened #12 to undo that test. If you can investigate what's going on there we can add it again either as a cfg'd test or as a regular test with some behavior fixed.

@9999years 9999years deleted the substitute-vars-in-tests branch June 12, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants