smoke test
This commit is contained in:
Generated
+4
-2
@@ -152,6 +152,8 @@ dependencies = [
|
||||
"card_game",
|
||||
"klondike",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -266,9 +268,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.149"
|
||||
version = "1.0.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
||||
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
|
||||
@@ -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