]> git.lizzy.rs Git - rust.git/commitdiff
Add test (issue 3005)
authorNick Cameron <ncameron@mozilla.com>
Mon, 15 Oct 2018 01:09:31 +0000 (14:09 +1300)
committerNick Cameron <ncameron@mozilla.com>
Mon, 15 Oct 2018 01:09:31 +0000 (14:09 +1300)
tests/source/match.rs
tests/target/match.rs

index 1643449773e28b37e5736526a118809f5f41d722..c5a5455cfc7e56f5f9e01bcf6ebb82b58c6135f1 100644 (file)
@@ -536,3 +536,16 @@ fn issue_3030() {
             }
     }
 }
+
+fn issue_3005() {
+            match *token {
+                 Token::Dimension {
+                     value, ref unit, ..
+                 } if num_context.is_ok(context.parsing_mode, value) =>
+                 {
+                     return NoCalcLength::parse_dimension(context, value, unit)
+                         .map(LengthOrPercentage::Length)
+                         .map_err(|()| location.new_unexpected_token_error(token.clone()))
+                 },
+             }
+}
index 130c9adfb3d553971036099290d6a8427f5973c8..c8a4022d2ac555597afe3fef6cffc82a3c648c8f 100644 (file)
@@ -564,3 +564,15 @@ fn issue_3030() {
             ) => {}
     }
 }
+
+fn issue_3005() {
+    match *token {
+        Token::Dimension {
+            value, ref unit, ..
+        } if num_context.is_ok(context.parsing_mode, value) => {
+            return NoCalcLength::parse_dimension(context, value, unit)
+                .map(LengthOrPercentage::Length)
+                .map_err(|()| location.new_unexpected_token_error(token.clone()))
+        }
+    }
+}