mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Fixed broken test
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
//explicitly support && and || short circuits
|
|
||||||
|
|
||||||
assert 1 && 2 == 2, "&& short-circuit failed";
|
|
||||||
|
|
||||||
assert 1 || 2 == 1, "|| short-circuit failed";
|
|
||||||
|
|
||||||
|
|
||||||
print "All good";
|
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ static void noPrintFn(const char* output) {
|
|||||||
//NO OP
|
//NO OP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int failedAssertions = 0;
|
||||||
int ignoredAssertions = 0;
|
int ignoredAssertions = 0;
|
||||||
static void noAssertFn(const char* output) {
|
static void noAssertFn(const char* output) {
|
||||||
if (strncmp(output, "!ignore", 7) == 0) {
|
if (strncmp(output, "!ignore", 7) == 0) {
|
||||||
@@ -27,6 +28,7 @@ static void noAssertFn(const char* output) {
|
|||||||
fprintf(stderr, TOY_CC_ERROR "Assertion failure: ");
|
fprintf(stderr, TOY_CC_ERROR "Assertion failure: ");
|
||||||
fprintf(stderr, "%s", output);
|
fprintf(stderr, "%s", output);
|
||||||
fprintf(stderr, "\n" TOY_CC_RESET); //default new line
|
fprintf(stderr, "\n" TOY_CC_RESET); //default new line
|
||||||
|
failedAssertions++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +141,6 @@ int main() {
|
|||||||
"polyfill-insert.toy",
|
"polyfill-insert.toy",
|
||||||
"polyfill-remove.toy",
|
"polyfill-remove.toy",
|
||||||
"short-circuit.toy",
|
"short-circuit.toy",
|
||||||
"short-circuiting-support.toy",
|
|
||||||
"ternary-expressions.toy",
|
"ternary-expressions.toy",
|
||||||
"trailing-comma-bugfix.toy",
|
"trailing-comma-bugfix.toy",
|
||||||
"types.toy",
|
"types.toy",
|
||||||
@@ -162,7 +163,10 @@ int main() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (failedAssertions == 0) {
|
||||||
printf(TOY_CC_NOTICE "All good\n" TOY_CC_RESET);
|
printf(TOY_CC_NOTICE "All good\n" TOY_CC_RESET);
|
||||||
return 0;
|
}
|
||||||
|
|
||||||
|
return failedAssertions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user