Re: [RFC][Outreachy] Seeking Git Community Feedback on My Application
From: Isoken Ibizugbe <hidden>
Date: 2023-10-28 14:09:31
On Sat, Oct 28, 2023 at 1:38 PM Christian Couder [off-list ref] wrote:
On Sat, Oct 28, 2023 at 12:41 PM Isoken Ibizugbe [off-list ref] wrote:quoted
On Sat, Oct 28, 2023 at 9:07 AM Christian Couder [off-list ref] wrote:quoted
quoted
quoted
#define DIGIT "0123456789" static void t_digit_type(void) { int i; const char *digits = DIGIT; for (i = 0; digits[i]; i++) { check_int(isdigit(digits[i]), ==, 0); }This tests that isdigit() returns 0 for each of the characters in "0123456789", but first I think isdigit() should return 1, not 0 for those characters.yes, that is true. should I send a re-roll?Yes, please.
#include "test-lib.h"
#include "ctype.h"
static void t_digit_type(void)
{
int i;
for (i = 0; i < 256; i++)
{
if (i < '0' || i > '9')
check_int(isdigit(i), ==, 0);
else
check_int(isdigit(i), ==, 1);
}
}
int main(void)
{
TEST(t_digit_type(), "Character is a digit");
return test_done();
}