-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves DMI saving (smaller files, better formatting) (#15)
- Loading branch information
1 parent
90c205c
commit 3374dbe
Showing
4 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use dmi::icon::Icon; | ||
use std::fs::File; | ||
use std::path::PathBuf; | ||
|
||
#[test] | ||
fn load_and_save_dmi() { | ||
let mut load_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
load_path.push("tests/resources/load_test.dmi"); | ||
let load_file = | ||
File::open(load_path.as_path()).unwrap_or_else(|_| panic!("No lights dmi: {load_path:?}")); | ||
let lights_icon = Icon::load(&load_file).expect("Unable to load lights dmi"); | ||
let mut write_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
write_path.push("tests/resources/save_test.dmi"); | ||
let mut write_file = File::create(write_path.as_path()).expect("Failed to create dmi file"); | ||
let _written_dmi = lights_icon | ||
.save(&mut write_file) | ||
.expect("Failed to save lights dmi"); | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.