Skip to content

Commit

Permalink
tests fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckram123 committed Feb 24, 2024
1 parent 47e1f89 commit 249ee3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tests/include_exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ fn get_works() {
assert!(AllAssets::get("index.html").is_some(), "index.html should exist");
assert!(AllAssets::get("gg.html").is_none(), "gg.html should not exist");
assert!(AllAssets::get("images/llama.png").is_some(), "llama.png should exist");
assert_eq!(AllAssets::iter().count(), 6);
assert!(AllAssets::get("symlinks/main.js").is_some(), "main.js should exist");
assert_eq!(AllAssets::iter().count(), 7);
}

#[derive(RustEmbed)]
Expand All @@ -36,8 +37,9 @@ struct ExcludeSomeAssets;
fn excluding_some_assets_works() {
assert!(ExcludeSomeAssets::get("index.html").is_none(), "index.html should not exist");
assert!(ExcludeSomeAssets::get("main.js").is_some(), "main.js should exist");
assert!(ExcludeSomeAssets::get("symlinks/main.js").is_some(), "main.js symlink should exist");
assert!(ExcludeSomeAssets::get("images/llama.png").is_none(), "llama.png should not exist");
assert_eq!(ExcludeSomeAssets::iter().count(), 2);
assert_eq!(ExcludeSomeAssets::iter().count(), 3);
}

#[derive(RustEmbed)]
Expand Down
4 changes: 2 additions & 2 deletions tests/interpolated_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn iter_works() {
assert!(Asset::get(file.as_ref()).is_some());
num_files += 1;
}
assert_eq!(num_files, 6);
assert_eq!(num_files, 7);
}

#[test]
Expand All @@ -32,6 +32,6 @@ fn trait_works_generic_helper<E: rust_embed::RustEmbed>() {
assert!(E::get(file.as_ref()).is_some());
num_files += 1;
}
assert_eq!(num_files, 6);
assert_eq!(num_files, 7);
assert!(E::get("gg.html").is_none(), "gg.html should not exist");
}
4 changes: 2 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn iter_works() {
assert!(Asset::get(file.as_ref()).is_some());
num_files += 1;
}
assert_eq!(num_files, 6);
assert_eq!(num_files, 7);
}

#[test]
Expand All @@ -41,6 +41,6 @@ fn trait_works_generic_helper<E: rust_embed::RustEmbed>() {
assert!(E::get(file.as_ref()).is_some());
num_files += 1;
}
assert_eq!(num_files, 6);
assert_eq!(num_files, 7);
assert!(E::get("gg.html").is_none(), "gg.html should not exist");
}

0 comments on commit 249ee3c

Please sign in to comment.