Browse Source

tests: Add tests for negative numbers with PREPEND_SPACE

Nicholas Bishop 3 weeks ago
parent
commit
ad00c1976b
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tests/tests.rs

+ 7 - 0
tests/tests.rs

@@ -142,6 +142,13 @@ fn test_int_length_signed() {
         assert_eq_fmt!(c"%lli", -211_126_823_125i64 => "-211126823125");
         assert_eq_fmt!(c"%lli", -211_126_823_125i64 => "-211126823125");
         assert_eq_fmt!(c"%ti", -211_126_823_125isize => "-211126823125");
         assert_eq_fmt!(c"%ti", -211_126_823_125isize => "-211126823125");
         assert_eq_fmt!(c"%zi", 211_126_823_125usize => "211126823125");
         assert_eq_fmt!(c"%zi", 211_126_823_125usize => "211126823125");
+
+        assert_eq_fmt!(c"% 5hhi", -125 => " -125");
+        assert_eq_fmt!(c"% 7hi", -23125 => " -23125");
+        assert_eq_fmt!(c"% 14li", -211_126_823_125i64 => " -211126823125");
+        assert_eq_fmt!(c"% 14lli", -211_126_823_125i64 => " -211126823125");
+        assert_eq_fmt!(c"% 14ti", -211_126_823_125isize => " -211126823125");
+        assert_eq_fmt!(c"% 13zi", 211_126_823_125usize => " 211126823125");
     }
     }
 }
 }