Open KishorBachhav opened 6 months ago
We verify this test in CI:
Running tests/cli.rs (target/debug/deps/cli-24b1554a734c1812)
running 2 tests
test file_doesnt_exist ... ok
test find_content_in_file ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
See https://github.com/rust-cli/book/actions/runs/8105132408/job/22152959899
The problem is that we are testing for a platform-specific message and only running CI on one platform.
Below test with more description can be found at
My Expectation: grss rightly throws the exception when file does not exist. This test should capture the exception and should be pass as it has captured the right exception. But on running 'cargo test', this test is reported as failure.
Current Result: test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.55s IMO Expected Result test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.55s
Output of cargo test: ` Running tests/cli.rs (target/debug/deps/cli-5cefbff21b07bd9f)
running 1 test test file_doesnt_exist ... FAILED
failures:
---- file_doesnt_exist stdout ---- thread 'file_doesnt_exist' panicked at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5: Unexpected stderr, failed var.contains(could not read file) ├── var: Error: Could not read file 'test/file/doesnt/exists' │
│ Caused by: │ No such file or directory (os error 2) └── var as str: Error: Could not read file 'test/file/doesnt/exists'
command=
"/Users/admin/Kishor/SxT/repos/grrs/target/debug/grrs" "foobar" "test/file/doesnt/exists"
code=1 stdout="" stderr=``` Error: Could not read file \'test/file/doesnt/exists\'Caused by: No such file or directory (os error 2)