this post was submitted on 22 Feb 2026
255 points (98.5% liked)

Programmer Humor

41092 readers
339 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] anton@lemmy.blahaj.zone 6 points 16 hours ago (1 children)

The test suite probably looks something like this:

int tests_passed=0;
int tests_failed=0;
for(int i=0;i<100000;i++){
    printf("test no. %d: ", i);
    if(is_prime(i)==actually_is_prime(i)){
        printf("passed\n");
        tests_passed++;
    }else{
        printf("failed\n");
        tests_failed++;
    }
}
//...

Ah that makes more sense thanks. So the bottom one is a unit test and not the code being run itself