diff options
| author | Brad Clawsie <brad@b7j0c.org> | 2026-11-25 14:18:46 -0600 |
|---|---|---|
| committer | Brad Clawsie <brad@b7j0c.org> | 2026-11-25 14:18:46 -0600 |
| commit | 7757056c7a43d4fbd85e3e817237d178bf6b1761 (patch) | |
| tree | 3c4fc7eac704b1237799b034d2d883aac8c1574c /learn_21/tests/load_config.rs | |
| parent | 07e343541d0e60e34e582d43efd8cf573f8bb344 (diff) | |
fix: learn_21
Diffstat (limited to 'learn_21/tests/load_config.rs')
| -rw-r--r-- | learn_21/tests/load_config.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/learn_21/tests/load_config.rs b/learn_21/tests/load_config.rs index 827ed02..5fc7866 100644 --- a/learn_21/tests/load_config.rs +++ b/learn_21/tests/load_config.rs @@ -16,8 +16,12 @@ fn test_load_config() -> io::Result<()> { file.write_all(b"host=myhost\nport=1\nworkers=1\n")?; } - assert!(load_config(&file_path).is_ok()); - assert!(load_config(std::path::Path::new("/bad/path")).is_err()); + assert!(load_config(&file_path).is_ok_and(|x| x == + Config{host:"myhost".to_string(), port:1, workers:1})); + assert!(matches!( + load_config(std::path::Path::new("/bad/path")), + Err(ConfigError::Io(Error)), + )); fs::remove_file(&file_path)?; Ok(()) |
