浏览代码

tests: Add tests for negative numbers with PREPEND_SPACE

Nicholas Bishop 3 月之前
父节点
当前提交
ad00c1976b
共有 1 个文件被更改,包括 7 次插入0 次删除
  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"%ti", -211_126_823_125isize => "-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");
     }
 }