Skip to content

Commit

Permalink
do.c
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed May 30, 2017
1 parent 0b33c5e commit 02c5b1a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/do.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
#include <stdio.h>
#include "tests.h"

int main() {
int main()
{
plan(5);

int i = 0;

// There will be 4 checks in the first loop.
do {
printf("do loop %d\n", i);
pass("%s", "first do statement");
i = i + 1;
} while( i < 4 );

// continue
// Only one check in the second loop.
i = 0;
do {
i++;
if(i < 3) continue;
printf("%d\n", i);
pass("%s", "second do statement");
} while(i < 3);

done_testing();
}

0 comments on commit 02c5b1a

Please sign in to comment.