add tests for non-existent hints

This commit is contained in:
Simon Gardling 2022-05-17 09:01:36 -04:00
parent d2095fb533
commit f6ca98a1f2
2 changed files with 24 additions and 1 deletions

View File

@ -99,7 +99,7 @@ impl<'a> AutoComplete<'a> {
self.apply_hint(hint);
}
}
_ => unreachable!(),
Hint::None => {}
}
}

View File

@ -113,6 +113,29 @@ fn multi() {
]);
}
#[test]
fn none() {
// string that should give no hints
let random = "qwert987gybhj";
ac_tester(&[
Action::SetString(random),
Action::AssertHint(""),
Action::Move(Movement::Up),
Action::AssertIndex(0),
Action::AssertString(random),
Action::AssertHint(""),
Action::Move(Movement::Down),
Action::AssertIndex(0),
Action::AssertString(random),
Action::AssertHint(""),
Action::Move(Movement::Complete),
Action::AssertString(random),
Action::AssertHint(""),
Action::AssertIndex(0),
]);
}
#[test]
fn parens() {
ac_tester(&[