~repos /rust-embed
git clone https://pyrossh.dev/repos/rust-embed.git
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
2ea69bc8
—
Mcat12 4 years ago
Format prefix tests
- tests/prefix.rs +6 -6
tests/prefix.rs
CHANGED
|
@@ -7,18 +7,18 @@ struct Asset;
|
|
|
7
7
|
|
|
8
8
|
#[test]
|
|
9
9
|
fn get_with_prefix() {
|
|
10
|
-
|
|
10
|
+
assert!(Asset::get("prefix/index.html").is_some());
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
#[test]
|
|
14
14
|
fn get_without_prefix() {
|
|
15
|
-
|
|
15
|
+
assert!(Asset::get("index.html").is_none());
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
#[test]
|
|
19
19
|
fn iter_values_have_prefix() {
|
|
20
|
-
|
|
20
|
+
for file in Asset::iter() {
|
|
21
|
-
|
|
21
|
+
assert!(file.starts_with("prefix/"));
|
|
22
|
-
|
|
22
|
+
assert!(Asset::get(file.as_ref()).is_some());
|
|
23
|
-
|
|
23
|
+
}
|
|
24
24
|
}
|