diff --git a/assets/icons/supermaven.svg b/assets/icons/supermaven.svg
deleted file mode 100644
index af778c70b7..0000000000
--- a/assets/icons/supermaven.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/crates/icons/src/icons.rs b/crates/icons/src/icons.rs
index 6a94f8c7b4..d1005517d7 100644
--- a/crates/icons/src/icons.rs
+++ b/crates/icons/src/icons.rs
@@ -309,3 +309,45 @@ impl IconName {
format!("icons/{file_stem}.svg").into()
}
}
+
+#[cfg(test)]
+mod tests {
+ use std::path::PathBuf;
+
+ use strum::{IntoEnumIterator as _, ParseError};
+
+ use crate::IconName;
+
+ #[test]
+ fn test_all_icons_exist() {
+ let asset_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../assets");
+
+ for icon in IconName::iter() {
+ let icon_path = asset_path.join(&*icon.path());
+ assert!(
+ icon_path.exists(),
+ "Icon {icon:?} does not exist at {icon_path:?}",
+ );
+ }
+ }
+
+ #[test]
+ fn test_no_dangling_icons() -> Result<(), ParseError> {
+ let icons_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../assets/icons");
+
+ for entry in std::fs::read_dir(&icons_dir).expect("failed to read icons directory") {
+ let path = entry.expect("failed to read icons directory entry").path();
+ if path.extension().is_none_or(|extension| extension != "svg") {
+ continue;
+ }
+ let file_stem = path
+ .file_stem()
+ .and_then(|file_stem| file_stem.to_str())
+ .expect("icon file name is not valid UTF-8");
+
+ file_stem.parse::()?;
+ }
+
+ Ok(())
+ }
+}