[librsvg] aspect_ratio.rs: Add test for parsing "none"
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] aspect_ratio.rs: Add test for parsing "none"
- Date: Thu, 2 Feb 2017 04:47:34 +0000 (UTC)
commit bf7c14c34a680cf6b8e96ca547e02b5977063ed2
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Feb 1 22:46:47 2017 -0600
aspect_ratio.rs: Add test for parsing "none"
rust/src/aspect_ratio.rs | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/rust/src/aspect_ratio.rs b/rust/src/aspect_ratio.rs
index bf44ab5..67c4e1d 100644
--- a/rust/src/aspect_ratio.rs
+++ b/rust/src/aspect_ratio.rs
@@ -315,7 +315,7 @@ impl FromStr for AspectRatio {
defer: defer,
align: match align {
Align::None => { Align::None },
- Align::Aligned { align, ..} => {
+ Align::Aligned { align, .. } => {
Align::Aligned {
align: align,
fit: fit_mode
@@ -393,6 +393,10 @@ mod tests {
#[test]
fn parses_valid_strings () {
+ assert_eq! (AspectRatio::from_str ("defer none"),
+ Ok (AspectRatio { defer: true,
+ align: Align::None }));
+
assert_eq! (AspectRatio::from_str ("XmidYmid"),
Ok (AspectRatio { defer: false,
align: Align::Aligned { align: AlignMode::XmidYmid,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]