smoke test
This commit is contained in:
@@ -8,5 +8,9 @@ card_game.workspace = true
|
||||
klondike.workspace = true
|
||||
rand = { version = "0.10.1", default-features = false, features = ["thread_rng"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = { version = "1.0.228", default-features = false }
|
||||
serde_json = "1.0.150"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -14,3 +14,16 @@ fn test_is_winnable() {
|
||||
println!("Game is not winnable");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serde() {
|
||||
let mut session = Session::new_default(Klondike::with_seed(124));
|
||||
let solution_result = session.solve();
|
||||
if let Ok(Some(solution)) = solution_result {
|
||||
for snapshot in solution.clean_solution() {
|
||||
session.process_instruction(snapshot.instruction().clone());
|
||||
}
|
||||
}
|
||||
let serialized = serde_json::to_string(&session).unwrap();
|
||||
println!("serialized = {serialized}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user