File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,30 @@ fn test_int() {
110110 }
111111}
112112
113+ #[ test]
114+ fn test_int_length_signed ( ) {
115+ unsafe {
116+ assert_eq_fmt ! ( c"%hhi" , -125 => "-125" ) ;
117+ assert_eq_fmt ! ( c"%hi" , -23125 => "-23125" ) ;
118+ assert_eq_fmt ! ( c"%li" , -211_126_823_125i64 => "-211126823125" ) ;
119+ assert_eq_fmt ! ( c"%lli" , -211_126_823_125i64 => "-211126823125" ) ;
120+ assert_eq_fmt ! ( c"%ti" , -211_126_823_125isize => "-211126823125" ) ;
121+ assert_eq_fmt ! ( c"%zi" , 211_126_823_125usize => "211126823125" ) ;
122+ }
123+ }
124+
125+ #[ test]
126+ fn test_int_length_unsigned ( ) {
127+ unsafe {
128+ assert_eq_fmt ! ( c"%hhu" , 125 => "125" ) ;
129+ assert_eq_fmt ! ( c"%hu" , 23125 => "23125" ) ;
130+ assert_eq_fmt ! ( c"%lu" , 211_126_823_125u64 => "211126823125" ) ;
131+ assert_eq_fmt ! ( c"%llu" , 211_126_823_125u64 => "211126823125" ) ;
132+ assert_eq_fmt ! ( c"%tu" , 211_126_823_125isize => "211126823125" ) ;
133+ assert_eq_fmt ! ( c"%zu" , 211_126_823_125usize => "211126823125" ) ;
134+ }
135+ }
136+
113137#[ test]
114138fn test_octal ( ) {
115139 unsafe {
You can’t perform that action at this time.
0 commit comments