|
|
@ -49,7 +49,7 @@ fn send_readyok() { |
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
fn engine_option_equality() { |
|
|
|
fn engine_option_equality() { |
|
|
|
let name = constants::HASH; |
|
|
|
let name = constants::HASH; |
|
|
|
let option_type = EngineOptionType::Check; |
|
|
|
let option_type = EngineOptionType::Spin; |
|
|
|
let option_data1 = |
|
|
|
let option_data1 = |
|
|
|
[(EngineOptionDataType::DefaultVal, EngineOptionData::Int(1)), |
|
|
|
[(EngineOptionDataType::DefaultVal, EngineOptionData::Int(1)), |
|
|
|
(EngineOptionDataType::Min, EngineOptionData::Int(1)), |
|
|
|
(EngineOptionDataType::Min, EngineOptionData::Int(1)), |
|
|
@ -75,3 +75,23 @@ fn engine_option_equality() { |
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(o1, o2); |
|
|
|
assert_eq!(o1, o2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
|
|
|
fn engine_option_string() { |
|
|
|
|
|
|
|
let name = constants::HASH; |
|
|
|
|
|
|
|
let option_type = EngineOptionType::Spin; |
|
|
|
|
|
|
|
let option_data = |
|
|
|
|
|
|
|
[(EngineOptionDataType::DefaultVal, EngineOptionData::Int(1)), |
|
|
|
|
|
|
|
(EngineOptionDataType::Min, EngineOptionData::Int(1)), |
|
|
|
|
|
|
|
(EngineOptionDataType::Max, EngineOptionData::Int(128)) |
|
|
|
|
|
|
|
].iter().cloned().collect(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let o = EngineOption { |
|
|
|
|
|
|
|
name: name, |
|
|
|
|
|
|
|
option_type: option_type, |
|
|
|
|
|
|
|
option_data: option_data1, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let expected = "option name hash type spin default 1 min 1 max 128"; |
|
|
|
|
|
|
|
assert_eq!(o.option_string(), expected); |
|
|
|
|
|
|
|
} |
|
|
|