| ... | ... | @@ -183,6 +183,8 @@ pub fn formatValue(value: var, context: var, output: fn(@typeOf(context), []cons |
| 183 | 183 | return output(context, casted_value); |
| 184 | 184 | } else if (T == void) { |
| 185 | 185 | return output(context, "void"); |
| 186 | } else if (T == bool) { |
| 187 | return output(context, if (value) "true" else "false"); |
| 186 | 188 | } else { |
| 187 | 189 | @compileError("Unable to format type '" ++ @typeName(T) ++ "'"); |
| 188 | 190 | } |
| ... | ... | @@ -363,7 +365,7 @@ fn countSize(size: &usize, bytes: []const u8) -> bool { |
| 363 | 365 | return true; |
| 364 | 366 | } |
| 365 | 367 | |
| 366 | | test "testBufPrintInt" { |
| 368 | test "buf print int" { |
| 367 | 369 | var buffer: [max_int_digits]u8 = undefined; |
| 368 | 370 | const buf = buffer[0...]; |
| 369 | 371 | assert(mem.eql(u8, bufPrintIntToSlice(buf, i32(-12345678), 2, false, 0), "-101111000110000101001110")); |
| ... | ... | @@ -385,7 +387,7 @@ fn bufPrintIntToSlice(buf: []u8, value: var, base: u8, uppercase: bool, width: u |
| 385 | 387 | return buf[0...formatIntBuf(buf, value, base, uppercase, width)]; |
| 386 | 388 | } |
| 387 | 389 | |
| 388 | | test "testParseU64DigitTooBig" { |
| 390 | test "parse u64 digit too big" { |
| 389 | 391 | _ = parseUnsigned(u64, "123a", 10) %% |err| { |
| 390 | 392 | if (err == error.InvalidChar) return; |
| 391 | 393 | unreachable; |
| ... | ... | @@ -393,7 +395,7 @@ test "testParseU64DigitTooBig" { |
| 393 | 395 | unreachable; |
| 394 | 396 | } |
| 395 | 397 | |
| 396 | | test "testParseUnsignedComptime" { |
| 398 | test "parse unsigned comptime" { |
| 397 | 399 | comptime { |
| 398 | 400 | assert(%%parseUnsigned(usize, "2", 10) == 2); |
| 399 | 401 | } |