jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.68k stars 105 forks source link

Unit tests are affected by local configuration #221

Closed oldaccountdeadname closed 1 year ago

oldaccountdeadname commented 3 years ago

Whan a unit test is run, ~/.config/amp/config.yml may be loaded in application initialization, and cause tests to fail when they should pass. For instance, if tab_width is set to anything but 2, cargo test output will include:

failures:
    commands::buffer::tests::backspace_outdents_line_if_line_is_whitespace
    commands::buffer::tests::indent_line_groups_multi_line_indents_as_a_single_operation
    commands::buffer::tests::indent_line_inserts_two_spaces_at_start_of_line
    commands::buffer::tests::indent_line_moves_cursor_in_insert_mode
    commands::buffer::tests::indent_line_works_in_select_line_mode
    commands::buffer::tests::indent_line_works_with_reversed_selections

Even though nothing has changed in the code and everything still works.