comparison src/th06/pbg3.rs @ 645:7bde50132735

Don’t hardcode my home directory in tests.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 03 Aug 2019 22:44:36 +0200
parents afa012bb8021
children 0ebf6467e4ff
comparison
equal deleted inserted replaced
644:f983a4c98410 645:7bde50132735
168 assert_eq!(pbg3.read_string(42).unwrap(), b"Hello world!"); 168 assert_eq!(pbg3.read_string(42).unwrap(), b"Hello world!");
169 } 169 }
170 170
171 #[test] 171 #[test]
172 fn file_present() { 172 fn file_present() {
173 let file = File::open("/home/linkmauve/games/pc/東方/TH06 ~ The Embodiment of Scarlet Devil/MD.DAT").unwrap(); 173 let file = File::open("EoSD/MD.DAT").unwrap();
174 let file = io::BufReader::new(file); 174 let file = io::BufReader::new(file);
175 let pbg3 = PBG3::from_file(file).unwrap(); 175 let pbg3 = PBG3::from_file(file).unwrap();
176 let files = pbg3.list_files().cloned().collect::<Vec<String>>(); 176 let files = pbg3.list_files().cloned().collect::<Vec<String>>();
177 assert!(files.contains(&String::from("th06_01.pos"))); 177 assert!(files.contains(&String::from("th06_01.pos")));
178 } 178 }
179 179
180 #[test] 180 #[test]
181 fn check_all_files() { 181 fn check_all_files() {
182 let file = File::open("/home/linkmauve/games/pc/東方/TH06 ~ The Embodiment of Scarlet Devil/MD.DAT").unwrap(); 182 let file = File::open("EoSD/MD.DAT").unwrap();
183 let file = io::BufReader::new(file); 183 let file = io::BufReader::new(file);
184 let mut pbg3 = PBG3::from_file(file).unwrap(); 184 let mut pbg3 = PBG3::from_file(file).unwrap();
185 let files = pbg3.list_files().cloned().collect::<Vec<String>>(); 185 let files = pbg3.list_files().cloned().collect::<Vec<String>>();
186 for filename in files { 186 for filename in files {
187 pbg3.get_file(filename, true).unwrap(); 187 pbg3.get_file(filename, true).unwrap();