From 4ed87916a556e788b48d47a9f8f71305452c2099 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Tue, 12 Dec 2017 15:42:11 -0800 Subject: [PATCH] Identity properly tested --- tests/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/lib.rs b/tests/lib.rs index 221ea68..333eba4 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,6 +1,7 @@ extern crate uci; use uci::Engine; +use std::str; #[test] fn instantiate_new_engine() { @@ -23,11 +24,9 @@ fn send_indentification_data() { e.identify(); } - println!("HERE!!!!!!!"); - println!("{:?}") - - - // To get this to play nicely the vector needs to be converted to utf-8 string(s) for comparison - - //assert_eq!(output, [b"id name test_name\n", b"id author test\n"]); + // NOTE: This looks weird bceause you'd think it would store each insertion into the output buffer + // as a separate element of that buffer, but it really just appends the two strings since in reality + // the buffer would be flushed after reading. + assert_eq!(str::from_utf8(&output).unwrap_or("Unwrapping output failed in test #2"), + "id name test_name\nid author test\n"); }