[librsvg] marker.rs: Split tests into modules for parser tests and directionality tests



commit 772f1e13bbc59193728199399606aeadd3bd95f3
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Mar 2 14:51:43 2017 -0600

    marker.rs: Split tests into modules for parser tests and directionality tests

 rust/src/marker.rs |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index 04f2733..4cddb38 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -776,7 +776,20 @@ fn emit_markers_for_path_builder<E> (builder: &RsvgPathBuilder,
 /******************** Tests ********************/
 
 #[cfg(test)]
-mod tests {
+mod parser_tests {
+    use super::*;
+
+    #[test]
+    fn parses_marker_units () {
+        assert_eq! (MarkerUnits::from_str ("foo"), Err (MarkerUnitsParseError));
+
+        assert_eq! (MarkerUnits::from_str ("userSpaceOnUse"), Ok (MarkerUnits::UserSpaceOnUse));
+        assert_eq! (MarkerUnits::from_str ("strokeWidth"),    Ok (MarkerUnits::StrokeWidth));
+    }
+}
+
+#[cfg(test)]
+mod directionality_tests {
     use std::f64::consts::*;
     use super::*;
     extern crate cairo;
@@ -1126,12 +1139,4 @@ mod tests {
         assert_eq! ((40.0, 30.0), (v1x, v1y));
         assert_eq! ((40.0, 30.0), (v2x, v2y));
     }
-
-    #[test]
-    fn parses_marker_units () {
-        assert_eq! (MarkerUnits::from_str ("foo"), Err (MarkerUnitsParseError));
-
-        assert_eq! (MarkerUnits::from_str ("userSpaceOnUse"), Ok (MarkerUnits::UserSpaceOnUse));
-        assert_eq! (MarkerUnits::from_str ("strokeWidth"),    Ok (MarkerUnits::StrokeWidth));
-    }
 }


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