mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.68k stars 38 forks source link

unit test fails: test_advance_search_with_filter_search_and_scrolling2 #44

Closed ProducerMatt closed 2 years ago

ProducerMatt commented 2 years ago
Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running unittests (target/debug/deps/tere-270a1999facff773)

running 30 tests
test app_state::history::tests_for_history_tree::test_from_abs_path ... ok
test app_state::history::tests_for_history_tree::test_change_dir ... ok
test app_state::history::tests_for_history_tree::test_go_to_root ... ok
test app_state::history::tests_for_history_tree::test_history_tree_go_up_down ... ok
test app_state::history::tests_for_history_tree::test_debug_print ... ok
test app_state::history::tests_for_history_tree::test_last_visisted_child ... ok
test app_state::history::tests_for_history_tree::test_tree_pointer_counts ... ok
test app_state::history::tests_for_history_tree::test_history_tree_visit ... ok
test app_state::history::tests_for_history_tree::test_serialize ... ok
test app_state::history::tests_for_history_tree::test_deserialize ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size1 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size2 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size3 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size5 ... ok
test app_state::tests::test_scrolling_bufsize_equal_to_window_size ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size4 ... ok
test ui::help_window::tests::test_strip_markup ... ok
test app_state::tests::test_scrolling_bufsize_less_than_window_size ... ok
test ui::help_window::tests::test_stylize_wrapped_lines ... ok
test app_state::tests::test_advance_search_wrap ... ok
test app_state::tests::test_basic_advance_search ... ok
test app_state::tests::test_advance_search_with_filter_search_and_scrolling ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_cursor_on_match2 ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_cursor_on_match ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_scrolling ... ok
test app_state::tests::test_advance_and_erase_search_with_cursor_on_match ... ok
test app_state::tests::test_advance_and_erase_with_filter_search ... ok
test app_state::tests::test_advance_and_clear_with_filter_search ... ok
test app_state::tests::test_advance_search_with_filter_search_and_scrolling2 ... FAILED
test ui::help_window::tests::test_user_guide_found ... ok

failures:

---- app_state::tests::test_advance_search_with_filter_search_and_scrolling2 stdout ----
thread 'app_state::tests::test_advance_search_with_filter_search_and_scrolling2' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `1`', src/app_state.rs:1302:9
stack backtrace:
   0:     0x562fb242f11c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf9a1e5015c7372de
   1:     0x562fb246414e - core::fmt::write::h9fe85dc123605e26
   2:     0x562fb2435db8 - std::io::Write::write_fmt::h669a8e5c6721b05b
   3:     0x562fb2446446 - std::panicking::default_hook::{{closure}}::h5be0c3f8bc5f82d3
   4:     0x562fb244611b - std::panicking::default_hook::h26c625e8da3d12e5
   5:     0x562fb2446a89 - std::panicking::rust_panic_with_hook::h9e5373efea59497b
   6:     0x562fb2430077 - std::panicking::begin_panic_handler::{{closure}}::h6675d1d897d2268b
   7:     0x562fb242f244 - std::sys_common::backtrace::__rust_end_short_backtrace::h2eebb466dcccf8e7
   8:     0x562fb2446582 - rust_begin_unwind
   9:     0x562fb21acb13 - core::panicking::panic_fmt::h388cf0442c96c658
  10:     0x562fb2463e28 - core::panicking::assert_failed_inner::hd0043323e1ada698
  11:     0x562fb23a249a - core::panicking::assert_failed::h90a5c29b4fafe7d0
                               at /build/rustc-1.60.0-src/library/core/src/panicking.rs:182:5
  12:     0x562fb21de589 - tere::app_state::tests::test_advance_search_with_filter_search_and_scrolling2::habde54d36d24058d
                               at /home/matt/tere/src/app_state.rs:1302:9
  13:     0x562fb21b2ffa - tere::app_state::tests::test_advance_search_with_filter_search_and_scrolling2::{{closure}}::hf403113eab43dc25
                               at /home/matt/tere/src/app_state.rs:1277:5
  14:     0x562fb21cdebe - core::ops::function::FnOnce::call_once::h1c97ee7d170ed169
                               at /build/rustc-1.60.0-src/library/core/src/ops/function.rs:227:5
  15:     0x562fb2211db3 - test::__rust_begin_short_backtrace::h626545a4b88d88d6
  16:     0x562fb2211f39 - test::run_test_in_process::h41943d41ab2a9a0f
  17:     0x562fb223e518 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd93c8f36d9bfcd36
  18:     0x562fb2224866 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7f08ed4d6f63ce2a
  19:     0x562fb2443793 - std::sys::unix::thread::Thread::new::thread_start::h17b4aae352c54ef4
  20:     0x7f28368caff2 - start_thread
  21:     0x7f283694dbfc - clone3
  22:                0x0 - <unknown>

failures:
    app_state::tests::test_advance_search_with_filter_search_and_scrolling2

test result: FAILED. 29 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass '--bin tere'

Encountered first on NixOS, then tested in an Ubuntu docker container.

mgunyho commented 2 years ago

Thanks! Indeed, I left this unresolved when I wrote the tests, I'm not sure anymore if the test is wrong or the code. I'll look into it at some point. Does the failing test prevent installation on Nix or something?

ProducerMatt commented 2 years ago

Sort of. I was using buildRustPackage, which automatically runs tests and fails the build if any test fails. Now that I know it's ok I'll just patch it to skip that test :)

ProducerMatt commented 2 years ago

"Tere" pkg now available in the unstable nixpkgs repository. :) https://github.com/NixOS/nixpkgs/pull/182654

mgunyho commented 2 years ago

Cool, thanks! You can also make a PR that updates the readme with a mention of the nix installation if you wish, though I won't be able to review it during the next couple of days.