[librsvg: 2/17] Don't nest the rsvg-convert color tests in a submodule




commit 4d30fe9b55e901ae4eb7c9892b3988c1ecfc5c91
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Feb 21 12:04:42 2022 -0600

    Don't nest the rsvg-convert color tests in a submodule
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/669>

 src/bin/rsvg-convert.rs | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)
---
diff --git a/src/bin/rsvg-convert.rs b/src/bin/rsvg-convert.rs
index 41f5919a3..963a054d7 100644
--- a/src/bin/rsvg-convert.rs
+++ b/src/bin/rsvg-convert.rs
@@ -1133,29 +1133,27 @@ fn main() {
 }
 
 #[cfg(test)]
-mod tests {
-    mod color {
-        use super::super::*;
+mod color_tests {
+    use super::*;
 
-        #[test]
-        fn valid_color_is_ok() {
-            assert!(parse_color_string("Red").is_ok());
-        }
+    #[test]
+    fn valid_color_is_ok() {
+        assert!(parse_color_string("Red").is_ok());
+    }
 
-        #[test]
-        fn none_is_handled_as_not_found() {
-            assert_eq!(
-                parse_color_string("None").map_err(|e| e.kind),
-                Err(clap::ErrorKind::ArgumentNotFound)
-            );
-        }
+    #[test]
+    fn none_is_handled_as_not_found() {
+        assert_eq!(
+            parse_color_string("None").map_err(|e| e.kind),
+            Err(clap::ErrorKind::ArgumentNotFound)
+        );
+    }
 
-        #[test]
-        fn invalid_is_handled_as_invalid_value() {
-            assert_eq!(
-                parse_color_string("foo").map_err(|e| e.kind),
-                Err(clap::ErrorKind::InvalidValue)
-            );
-        }
+    #[test]
+    fn invalid_is_handled_as_invalid_value() {
+        assert_eq!(
+            parse_color_string("foo").map_err(|e| e.kind),
+            Err(clap::ErrorKind::InvalidValue)
+        );
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]