~repos /rust-embed

#rust#proc-macro#http

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.


7275dfbc Liran Piade

9 months ago
Add unit test
Files changed (1) hide show
  1. tests/allow_missing.rs +11 -0
tests/allow_missing.rs ADDED
@@ -0,0 +1,11 @@
1
+ use rust_embed::Embed;
2
+
3
+ #[derive(Embed)]
4
+ #[folder = "examples/missing/"]
5
+ #[allow_missing = true]
6
+ struct Asset;
7
+
8
+ #[test]
9
+ fn missing_is_empty() {
10
+ assert_eq!(Asset::iter().count(), 0);
11
+ }