[librsvg: 18/21] Test that translate/scale/skew without the optional parameter produce the correct result
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 18/21] Test that translate/scale/skew without the optional parameter produce the correct result
- Date: Tue, 31 Aug 2021 18:37:38 +0000 (UTC)
commit beb88b5f53ad2d32ef24d916be854003e2452afb
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Aug 31 12:25:10 2021 -0500
Test that translate/scale/skew without the optional parameter produce the correct result
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/576>
src/transform.rs | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/transform.rs b/src/transform.rs
index cc56eaad..fdfd212a 100644
--- a/src/transform.rs
+++ b/src/transform.rs
@@ -872,7 +872,11 @@ mod tests {
&parse_transform_prop("translate(100px,200px)").unwrap()
);
- assert!(parse_transform_prop("translate(1)").is_ok());
+ assert_eq!(
+ parse_transform_prop("translate(1)").unwrap(),
+ parse_transform_prop("translate(1, 0)").unwrap()
+ );
+
assert!(parse_transform_prop("translate(100, foo)").is_err());
assert!(parse_transform_prop("translate(100, )").is_err());
assert!(parse_transform_prop("translate(100 200)").is_err());
@@ -910,7 +914,11 @@ mod tests {
let tps = TransformProperty::List(vec![TransformFunction::Scale(1.0, 10.0)]);
assert_eq!(&tps, &parse_transform_prop("scale(1,10)").unwrap());
- assert!(parse_transform_prop("scale(1)").is_ok());
+
+ assert_eq!(
+ parse_transform_prop("scale(2)").unwrap(),
+ parse_transform_prop("scale(2, 2)").unwrap()
+ );
assert!(parse_transform_prop("scale(100, foo)").is_err());
assert!(parse_transform_prop("scale(100, )").is_err());
@@ -956,7 +964,12 @@ mod tests {
)]);
assert_eq!(&tpsk, &parse_transform_prop("skew(90deg,120deg)").unwrap());
- assert!(parse_transform_prop("skew(1)").is_ok());
+
+ assert_eq!(
+ parse_transform_prop("skew(45deg)").unwrap(),
+ parse_transform_prop("skew(45deg, 0)").unwrap()
+ );
+
assert!(parse_transform_prop("skew(1.0,1.0)").is_ok());
assert!(parse_transform_prop("skew(1rad,1rad)").is_ok());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]