• Home
  • Raw
  • Download

Lines Matching refs:inifile

157             let mut inifile = IniFile::new(filepath.clone());  in test_read()  localVariable
158 inifile.read().unwrap(); in test_read()
160 assert!(!inifile.contains_key("unknown-key")); in test_read()
161 assert!(inifile.contains_key("port"), "Fail in test case: {test_case}"); in test_read()
162 assert_eq!(inifile.get("port").unwrap(), "123"); in test_read()
163 assert_eq!(inifile.get("unknown-key"), None); in test_read()
184 let mut inifile = IniFile::new(filepath.clone()); in test_read_no_newline() localVariable
185 inifile.read().unwrap(); in test_read_no_newline()
187 assert!(!inifile.contains_key("unknown-key")); in test_read_no_newline()
188 assert!(inifile.contains_key("port")); in test_read_no_newline()
189 assert_eq!(inifile.get("port").unwrap(), "123"); in test_read_no_newline()
190 assert_eq!(inifile.get("unknown-key"), None); in test_read_no_newline()
198 let mut inifile = IniFile::new(filepath.clone()); in test_read_no_file() localVariable
199 assert!(inifile.read().is_err()); in test_read_no_file()
214 let mut inifile = IniFile::new(filepath.clone()); in test_read_multiple_lines() localVariable
215 inifile.read().unwrap(); in test_read_multiple_lines()
217 assert!(!inifile.contains_key("unknown-key")); in test_read_multiple_lines()
218 assert!(inifile.contains_key("port")); in test_read_multiple_lines()
219 assert!(inifile.contains_key("port2")); in test_read_multiple_lines()
220 assert_eq!(inifile.get("port").unwrap(), "123"); in test_read_multiple_lines()
221 assert_eq!(inifile.get("port2").unwrap(), "456"); in test_read_multiple_lines()
222 assert_eq!(inifile.get("unknown-key"), None); in test_read_multiple_lines()
231 let mut inifile = IniFile::new(filepath); in test_insert_and_contains_key() localVariable
233 assert!(!inifile.contains_key("port")); in test_insert_and_contains_key()
234 assert!(!inifile.contains_key("unknown-key")); in test_insert_and_contains_key()
236 inifile.insert("port", "123"); in test_insert_and_contains_key()
238 assert!(inifile.contains_key("port")); in test_insert_and_contains_key()
239 assert!(!inifile.contains_key("unknown-key")); in test_insert_and_contains_key()
240 assert_eq!(inifile.get("port").unwrap(), "123"); in test_insert_and_contains_key()
241 assert_eq!(inifile.get("unknown-key"), None); in test_insert_and_contains_key()
244 inifile.insert("port", "234"); in test_insert_and_contains_key()
246 assert!(inifile.contains_key("port")); in test_insert_and_contains_key()
247 assert!(!inifile.contains_key("unknown-key")); in test_insert_and_contains_key()
248 assert_eq!(inifile.get("port").unwrap(), "234"); in test_insert_and_contains_key()
249 assert_eq!(inifile.get("unknown-key"), None); in test_insert_and_contains_key()
256 let mut inifile = IniFile::new(filepath.clone()); in test_write() localVariable
258 assert!(!inifile.contains_key("port")); in test_write()
259 assert!(!inifile.contains_key("unknown-key")); in test_write()
261 inifile.insert("port", "123"); in test_write()
263 assert!(inifile.contains_key("port")); in test_write()
264 assert!(!inifile.contains_key("unknown-key")); in test_write()
265 assert_eq!(inifile.get("port").unwrap(), "123"); in test_write()
266 assert_eq!(inifile.get("unknown-key"), None); in test_write()
268 if inifile.write().is_err() { in test_write()
285 let mut inifile = IniFile::new(filepath.clone()); in test_write_and_read() localVariable
287 assert!(!inifile.contains_key("port")); in test_write_and_read()
288 assert!(!inifile.contains_key("port2")); in test_write_and_read()
289 assert!(!inifile.contains_key("unknown-key")); in test_write_and_read()
291 inifile.insert("port", "123"); in test_write_and_read()
292 inifile.insert("port2", "456"); in test_write_and_read()
294 assert!(inifile.contains_key("port")); in test_write_and_read()
295 assert!(!inifile.contains_key("unknown-key")); in test_write_and_read()
296 assert_eq!(inifile.get("port").unwrap(), "123"); in test_write_and_read()
297 assert_eq!(inifile.get("unknown-key"), None); in test_write_and_read()
299 if inifile.write().is_err() { in test_write_and_read()
304 let mut inifile = IniFile::new(filepath.clone()); in test_write_and_read() localVariable
305 inifile.read().unwrap(); in test_write_and_read()
307 assert!(!inifile.contains_key("unknown-key")); in test_write_and_read()
308 assert!(inifile.contains_key("port")); in test_write_and_read()
309 assert!(inifile.contains_key("port2")); in test_write_and_read()
310 assert_eq!(inifile.get("port").unwrap(), "123"); in test_write_and_read()
311 assert_eq!(inifile.get("port2").unwrap(), "456"); in test_write_and_read()
312 assert_eq!(inifile.get("unknown-key"), None); in test_write_and_read()
328 let mut inifile = IniFile::new(filepath.clone()); in test_overwrite() localVariable
329 inifile.insert("port3", "789"); in test_overwrite()
331 inifile.write().unwrap(); in test_overwrite()