Add testcase for reading multiple lines
This commit is contained in:
parent
ef3b60eea5
commit
87d6f1221f
1 changed files with 21 additions and 0 deletions
|
@ -123,5 +123,26 @@ Hello World"#).unwrap();
|
|||
assert_eq!(bah.get_content(), "Hello World");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lazy_file_multiline() {
|
||||
let fs = InMemoryFileAbstraction::new();
|
||||
|
||||
let mut path = PathBuf::from("tests");
|
||||
path.set_file_name("test1");
|
||||
let mut lf = InMemoryFileAbstractionInstance::new(fs.backend().clone(), path.clone());
|
||||
|
||||
let loca = StoreId::new_baseless(path).unwrap();
|
||||
let file = Entry::from_str(loca.clone(), r#"---
|
||||
[imag]
|
||||
version = "0.7.0"
|
||||
---
|
||||
Hello World
|
||||
baz"#).unwrap();
|
||||
|
||||
lf.write_file_content(&file).unwrap();
|
||||
let bah = lf.get_file_content(loca).unwrap();
|
||||
assert_eq!(bah.get_content(), "Hello World\nbaz");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue