Get GNU MPFR and MPC tests to pass

This change fixes more issues with our scanf() function.
This commit is contained in:
Justine Tunney 2023-08-21 12:16:52 -07:00
parent 63a1636e1f
commit 6ef2a471e4
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
37 changed files with 389 additions and 865 deletions

View file

@ -17,8 +17,10 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/mem/gc.internal.h"
#include "libc/stdio/stdio.h"
#include "libc/testlib/testlib.h"
#include "libc/x/xasprintf.h"
TEST(fprintf, testWriteError) {
// Only Linux, NetBSD and FreeBSD are known to have /dev/full
@ -32,3 +34,8 @@ TEST(fprintf, testWriteError) {
ASSERT_EQ(fclose(fp), 0);
}
TEST(fun, test) {
ASSERT_STREQ("-0x1.4p+0", gc(xasprintf("%a", -1.25)));
ASSERT_STREQ("0x1p-17", gc(xasprintf("%a", 7.62939453125e-6)));
}