kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
712 stars 25 forks source link

How to run tests locally? #170

Closed orhun closed 1 year ago

orhun commented 1 year ago

Hello! 🐻

I'm trying to run the tests locally via cargo test and I'm getting the following errors:

failures:

---- magic_packed::tests::test_inspect_signature stdout ----
thread 'magic_packed::tests::test_inspect_signature' panicked at 'called `Result::unwrap()` on an `Err` value: Io("No such file or directory (os error 2)")', src/magic_packed.rs:311:72

---- functions::tests::test_list_up_contents stdout ----
thread 'functions::tests::test_list_up_contents' panicked at 'called `Result::unwrap()` on an `Err` value: Io("No such file or directory (os error 2)")', src/functions.rs:355:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- magic_image::tests::test_inspect_image stdout ----
thread 'magic_image::tests::test_inspect_image' panicked at 'called `Result::unwrap()` on an `Err` value: Io("No such file or directory (os error 2)")', src/magic_image.rs:105:59

I think it is due to testdata folder being not present. However, there doesn't seem a way to retrieve it since it is added to .gitignore:

https://github.com/kyoheiu/felix/blob/a3bab46a2e9bf8e17c18851672c156f0ccc0e4ee/.gitignore#L4

Do you mind committing these files to the repository or providing another way to run the tests?

kyoheiu commented 1 year ago

Added testfiles. 3d292426eaf70d91971135501258a6e43b7661a4 This should allow you to run test. (Image files are heavy, so I'll replace them with lighter ones in the near future)

orhun commented 1 year ago

Works like a charm, thanks!