Verified Commit fdcea16d authored by Phil Booth's avatar Phil Booth

chore(tests): add a utf8 file test

parent 9eb83cd5
Pipeline #33745381 passed with stage
in 3 minutes and 44 seconds
......@@ -37,7 +37,6 @@ macro_rules! metadata {
pub struct File {
path: PathBuf,
// TODO: give this struct its own token arena?
}
impl File {
......
......@@ -94,3 +94,17 @@ fn ascii_file() {
include_str!("../../fixtures/ascii.txt")
);
}
#[test]
fn utf8_file() {
let file = File::new("fixtures/utf8.txt");
assert_eq!(file.path().as_os_str(), "fixtures/utf8.txt");
assert_eq!(file.exists().unwrap(), true);
assert_eq!(file.is_directory().unwrap(), false);
assert!(file.last_modified_at().is_ok());
assert_eq!(
file.read().unwrap(),
include_str!("../../fixtures/utf8.txt")
);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment