Merge branch 'repl' into repl-warnings

Signed-off-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
Richard Feldman 2022-11-03 20:05:18 -07:00 committed by GitHub
commit 0657c38bb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 115 deletions

View file

@ -88,7 +88,7 @@ fn exhaustiveness_problem() {
#[test]
fn tips() {
assert!(!is_incomplete(""));
assert_eq!(ReplState::new().step(""), Ok(TIPS.to_string()));
assert_eq!(ReplState::new().step("", None), Ok(TIPS.to_string()));
}
#[test]
@ -98,7 +98,7 @@ fn standalone_annotation() {
incomplete(&mut input);
assert!(!is_incomplete(&input));
assert_eq!(state.step(&input), Ok(String::new()));
assert_eq!(state.step(&input, None), Ok(String::new()));
}
/// validate and step the given input, then check the Result vs the output
@ -106,7 +106,7 @@ fn standalone_annotation() {
fn complete(input: &str, state: &mut ReplState, expected_step_result: Result<(&str, &str), i32>) {
assert!(!is_incomplete(input));
match state.step(input) {
match state.step(input, None) {
Ok(string) => {
let escaped =
std::string::String::from_utf8(strip_ansi_escapes::strip(string.trim()).unwrap())
@ -144,7 +144,7 @@ fn incomplete(input: &mut String) {
fn error(input: &str, state: &mut ReplState, expected_step_result: String) {
assert!(!is_incomplete(input));
let escaped = state.step(input).map(|string| {
let escaped = state.step(input, None).map(|string| {
std::string::String::from_utf8(strip_ansi_escapes::strip(string.trim()).unwrap()).unwrap()
});