morpion_solitaire_records/
lib.rs1#![forbid(unsafe_code)]
26#![warn(missing_docs)]
27
28pub const RECORDS: &[(&str, &str, &str)] = &[
33 (
34 "Rosin 178",
35 "rosin178",
36 include_str!("../records/5T/rosin178.json"),
37 ),
38 (
39 "Rosin 177A",
40 "rosin177a",
41 include_str!("../records/5T/rosin177a.json"),
42 ),
43 (
44 "Rosin 177B",
45 "rosin177b",
46 include_str!("../records/5T/rosin177b.json"),
47 ),
48 (
49 "Tishchenko 172",
50 "tishchenko172",
51 include_str!("../records/5T/tishchenko172.json"),
52 ),
53 (
54 "Rosin 172",
55 "rosin172",
56 include_str!("../records/5T/rosin172.json"),
57 ),
58 (
59 "Tishchenko 171",
60 "tishchenko171",
61 include_str!("../records/5T/tishchenko171.json"),
62 ),
63 (
64 "Bruneau 170",
65 "bruneau170",
66 include_str!("../records/5T/bruneau170.json"),
67 ),
68 (
69 "Rosin 170A",
70 "rosin170a",
71 include_str!("../records/5T/rosin170a.json"),
72 ),
73 (
74 "Akiyama 146",
75 "akiyama146",
76 include_str!("../records/5T/akiyama146.json"),
77 ),
78 (
79 "Akiyama 145",
80 "akiyama145",
81 include_str!("../records/5T/akiyama145.json"),
82 ),
83 (
84 "Rosin 82 (5D)",
85 "rosin82",
86 include_str!("../records/5D/rosin82.json"),
87 ),
88 (
89 "Hyyrö–Poranen 62 (4T)",
90 "hyyroporanen62",
91 include_str!("../records/4T/hyyroporanen62.json"),
92 ),
93 (
94 "Demaine 56 (4T)",
95 "demaine56",
96 include_str!("../records/4T/demaine56.json"),
97 ),
98 (
99 "Hyyrö–Poranen 35 (4D)",
100 "hyyroporanen35",
101 include_str!("../records/4D/hyyroporanen35.json"),
102 ),
103 (
104 "Demaine 31 (4D)",
105 "demaine31",
106 include_str!("../records/4D/demaine31.json"),
107 ),
108];
109
110#[cfg(test)]
111mod tests {
112 use super::RECORDS;
113
114 #[test]
116 fn all_records_decode_and_validate() {
117 assert!(!RECORDS.is_empty());
118 for (name, _id, record) in RECORDS {
119 let game = msr::decode(record).unwrap_or_else(|e| panic!("{name}: decode failed: {e}"));
120 msr::validate(&game).unwrap_or_else(|e| panic!("{name}: not a legal game: {e}"));
121 }
122 }
123}