Commit d26a940
tests: fix this too opinionated test suite to work on my machine
Before those fixes, running the test suite resulted in the following
errors:
```
running 9 tests
test tests::test_can_tail_file_with_directory ... ok
test tests::test_can_tail_file_with_nonexistent_file ... FAILED
test tests::test_can_tail_file_with_existing_file ... ok
test tests::test_can_tail_file_with_unreadable_file ... ok
test tests::test_run_command_nonexistent_command ... ok
test tests::test_run_command_success ... ok
test tests::test_run_command_with_args ... ok
test tests::test_main_fails_without_fallback_command ... FAILED
test tests::test_run_command_calling_tailor_again ... ok
failures:
---- tests::test_can_tail_file_with_nonexistent_file stdout ----
thread 'tests::test_can_tail_file_with_nonexistent_file' panicked at src/main.rs:114:9:
Should not be able to tail a nonexistent file
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- tests::test_main_fails_without_fallback_command stdout ----
thread 'tests::test_main_fails_without_fallback_command' panicked at /home/skia/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5:
Unexpected success
command=`"/home/skia/workspace/ubuntu/tailor/target/debug/tailor" "/tmp/nonexistent_file_12345"`
code=0
stdout=""
stderr=""
failures:
tests::test_can_tail_file_with_nonexistent_file
tests::test_main_fails_without_fallback_command
test result: FAILED. 7 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
```
I believe this is because the test suite is too opinionated, and relies
on an arbitrary file not existing.
I happened to use that important file in my personal workflow, hence the
test suite broke.
Thankfully, I'm a nice contributor and was able to use my skills to fix
this. It now passes on my machine. Thank you.1 parent 8761b7a commit d26a940
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | | - | |
| 222 | + | |
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
| |||
0 commit comments