Make major improvements to stdio
Buffering now has optimal performance, bugs have been fixed, and some missing apis have been introduced. This implementation is also now more production worthy since it's less brittle now in terms of system errors. That's going to help redbean since lua i/o is all based on stdio. See #97
This commit is contained in:
@ -16,7 +16,10 @@
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "net/http/escape.h"
|
||||
|
||||
@ -39,3 +42,12 @@ TEST(escapehtml, testLargeGrowth) {
|
||||
TEST(escapehtml, testEmpty) {
|
||||
EXPECT_STREQ("", gc(escapehtml("")));
|
||||
}
|
||||
|
||||
TEST(escapehtml, testAstralPlanes_doesNothing) {
|
||||
EXPECT_STREQ("𐌰", escapehtml("𐌰"));
|
||||
}
|
||||
|
||||
BENCH(escapehtml, bench) {
|
||||
EZBENCH2("escapehtml", donothing,
|
||||
free(EscapeHtml(kHyperion, kHyperionSize).data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user