From 249ee3c8f1dc36f74f5523eb54e38fbafeb395ed Mon Sep 17 00:00:00 2001 From: Buckram Date: Sat, 24 Feb 2024 14:55:50 +0200 Subject: [PATCH] tests fixes --- tests/include_exclude.rs | 6 ++++-- tests/interpolated_path.rs | 4 ++-- tests/lib.rs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/include_exclude.rs b/tests/include_exclude.rs index e49c667..a0dd99d 100644 --- a/tests/include_exclude.rs +++ b/tests/include_exclude.rs @@ -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)] @@ -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)] diff --git a/tests/interpolated_path.rs b/tests/interpolated_path.rs index 0df2366..e446eef 100644 --- a/tests/interpolated_path.rs +++ b/tests/interpolated_path.rs @@ -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] @@ -32,6 +32,6 @@ fn trait_works_generic_helper() { 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"); } diff --git a/tests/lib.rs b/tests/lib.rs index a4636aa..b3d6433 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -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] @@ -41,6 +41,6 @@ fn trait_works_generic_helper() { 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"); }