]> git.lizzy.rs Git - rust.git/commitdiff
extra: Add a testcase for #7256.
authorHuon Wilson <dbau.pp+github@gmail.com>
Thu, 20 Jun 2013 15:07:05 +0000 (01:07 +1000)
committerHuon Wilson <dbau.pp+github@gmail.com>
Thu, 20 Jun 2013 15:07:05 +0000 (01:07 +1000)
src/libextra/time.rs

index 50592d5f7309de31c8c35b057e520a6df40b293c..973aa58921c6ff883fcbaf3cc4a8adca3c8114e4 100644 (file)
@@ -1138,6 +1138,9 @@ fn test(s: &str, format: &str) -> bool {
         assert!(result::unwrap(strptime("-0800", "%z")).tm_gmtoff ==
             0);
         assert!(test("%", "%%"));
+
+        // Test for #7256
+        assert_eq!(strptime("360", "%Y-%m-%d"), Err(~"Invalid year"))
     }
 
     fn test_ctime() {