Skip to content

Commit

Permalink
add test to no bom files
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jan 22, 2021
1 parent c1f5854 commit 87f5bfb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,21 @@ Key = 'Value # This is not a comment ; at all'
assert_eq!(ini.get_from(Some("Test"), "Key"), Some("Value"));
}

#[test]
fn load_from_file_without_bom() {
let file_name = temp_dir().join("rust_ini_load_from_file_without_bom");

let file_content = b"[Test]Key=Value\n";

{
let mut file = File::create(&file_name).expect("create");
file.write_all(file_content).expect("write");
}

let ini = Ini::load_from_file(&file_name).unwrap();
assert_eq!(ini.get_from(Some("Test"), "Key"), Some("Value"));
}

#[test]
fn get_with_non_static_key() {
let input = "key1=val1\nkey2=val2\n";
Expand Down

0 comments on commit 87f5bfb

Please sign in to comment.