Make more improvements
This change includes many bug fixes, for the NT polyfills, strings, memory, boot, and math libraries which were discovered by adding more tools for recreational programming, such as PC emulation. Lemon has also been vendored because it works so well at parsing languages.
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/conv/itoa.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/escape/escape.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/math.h"
|
||||
@ -671,6 +672,12 @@ TEST(snprintf, twosBaneWithTypePromotion) {
|
||||
EXPECT_STREQ("-32768", Format("%hd", x));
|
||||
}
|
||||
|
||||
TEST(snprintf, formatStringLiteral) {
|
||||
EXPECT_EQ('\\' | 'n' << 8, cescapec('\n'));
|
||||
EXPECT_EQ('\\' | '3' << 8 | '7' << 16 | '7' << 24, cescapec('\377'));
|
||||
EXPECT_STREQ("\"hi\\n\"", Format("%`'s", "hi\n"));
|
||||
}
|
||||
|
||||
BENCH(palandprintf, bench) {
|
||||
EZBENCH2("snprintf %x", donothing, Format("%x", VEIL("r", INT_MIN)));
|
||||
EZBENCH2("snprintf %d", donothing, Format("%d", VEIL("r", INT_MIN)));
|
||||
|
||||
Reference in New Issue
Block a user