Browse Source

Identity properly tested

ag-yep
Taylor Bockman 7 years ago
parent
commit
4ed87916a5
  1. 13
      tests/lib.rs

13
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");
}

Loading…
Cancel
Save