diff options
Diffstat (limited to 'crates/shirabe/tests/io')
| -rw-r--r-- | crates/shirabe/tests/io/buffer_io_test.rs | 10 | ||||
| -rw-r--r-- | crates/shirabe/tests/io/console_io_test.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/tests/io/null_io_test.rs | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/crates/shirabe/tests/io/buffer_io_test.rs b/crates/shirabe/tests/io/buffer_io_test.rs index 5bb18014..c33fd804 100644 --- a/crates/shirabe/tests/io/buffer_io_test.rs +++ b/crates/shirabe/tests/io/buffer_io_test.rs @@ -19,9 +19,11 @@ fn test_set_user_inputs() { assert!(!buffer_io.ask_confirmation("Now please say no!".to_string(), true)); assert_eq!( PhpMixed::String("default".to_string()), - buffer_io.ask( - "Empty string last".to_string(), - PhpMixed::String("default".to_string()) - ) + buffer_io + .ask( + "Empty string last".to_string(), + PhpMixed::String("default".to_string()) + ) + .unwrap() ); } diff --git a/crates/shirabe/tests/io/console_io_test.rs b/crates/shirabe/tests/io/console_io_test.rs index 03307e51..15e7100b 100644 --- a/crates/shirabe/tests/io/console_io_test.rs +++ b/crates/shirabe/tests/io/console_io_test.rs @@ -196,7 +196,9 @@ fn test_ask() { // PHP asserts QuestionHelper::ask receives a Question. Behaviorally, an interactive input whose // stream yields the answer makes ConsoleIO::ask return that answer. let (console_io, _output) = make_console_io_with_answer("answer\n"); - let result = console_io.ask("Why?".to_string(), PhpMixed::String("default".to_string())); + let result = console_io + .ask("Why?".to_string(), PhpMixed::String("default".to_string())) + .unwrap(); assert_eq!(PhpMixed::String("answer".to_string()), result); } @@ -247,7 +249,7 @@ fn test_select() { ); assert_eq!( PhpMixed::List(vec![PhpMixed::String("1".to_string())]), - result + result.unwrap() ); } diff --git a/crates/shirabe/tests/io/null_io_test.rs b/crates/shirabe/tests/io/null_io_test.rs index 1627e91f..ced598b9 100644 --- a/crates/shirabe/tests/io/null_io_test.rs +++ b/crates/shirabe/tests/io/null_io_test.rs @@ -45,6 +45,7 @@ fn test_ask() { assert_eq!( PhpMixed::String("foo".to_string()), io.ask("bar".to_string(), PhpMixed::String("foo".to_string())) + .unwrap() ); } @@ -88,5 +89,6 @@ fn test_select() { "foo".to_string(), true ) + .unwrap() ); } |
