[librsvg: 19/28] path_parser: Test vertical lineto args



commit 20a96c47db37f3fcfa28911ad3f2b0bb94c27219
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Jan 23 10:39:20 2018 -0600

    path_parser: Test vertical lineto args

 rust/src/path_parser.rs | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/rust/src/path_parser.rs b/rust/src/path_parser.rs
index 7b3c4e3..fc6ab1c 100644
--- a/rust/src/path_parser.rs
+++ b/rust/src/path_parser.rs
@@ -1668,5 +1668,23 @@ mod tests {
                     "       ^",
                     &vec![moveto(10.0, -20.0)],
                     Some(ErrorKind::UnexpectedToken));
+
+    #[test]
+    fn vertical_lineto_args() {
+        test_parser("M10-20v",
+                    "       ^",
+                    &vec![moveto(10.0, -20.0)],
+                    Some(ErrorKind::UnexpectedEof));
+
+        test_parser("M10-20v,",
+                    "       ^",
+                    &vec![moveto(10.0, -20.0)],
+                    Some(ErrorKind::UnexpectedToken));
+
+        test_parser("M10-20v30,",
+                    "          ^",
+                    &vec![moveto(10.0, -20.0),
+                          lineto(10.0, 10.0)],
+                    Some(ErrorKind::UnexpectedEof));
     }
 }


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