aboutsummaryrefslogtreecommitdiff
path: root/example/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'example/src/main.rs')
-rw-r--r--example/src/main.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/example/src/main.rs b/example/src/main.rs
index 5ee48f3..30436db 100644
--- a/example/src/main.rs
+++ b/example/src/main.rs
@@ -10,3 +10,15 @@ fn main() {
println!("Found: {}", name);
}
}
+
+#[test]
+fn test() {
+ assert_eq!(FILES.get("data/foo").expect("data/foo not present").into_owned(), &[102, 111, 111, 10]);
+
+ let files = FILES.file_names().collect::<Vec<_>>();
+ assert_eq!(files, vec!["data/inner/boom", "data/foo", "data/empty"]);
+
+ assert_eq!(FILES.get("data/inner/boom").unwrap().into_owned(), &[98, 111, 111, 109, 10]);
+ assert_eq!(FILES.get("data/foo").unwrap().into_owned(), &[102, 111, 111, 10]);
+ assert_eq!(FILES.get("data/empty").unwrap().into_owned(), &[]);
+}