Run all passing json against parse_many. Empty documents pass, too.

This commit is contained in:
John Keiser 2020-06-04 18:12:43 -07:00
parent c4a0fe1606
commit 3e226795f0
1 changed files with 15 additions and 11 deletions

View File

@ -83,17 +83,21 @@ bool validate(const char *dirname) {
if (contains("EXCLUDE", name)) {
// skipping
how_many--;
} else if (starts_with("pass", name) and (has_extension(extension1, name) or has_extension(extension2, name)) and error) {
is_file_as_expected[i] = false;
printf("warning: file %s should pass but it fails. Error is: %s\n",
name, error_message(error));
printf("size of file in bytes: %zu \n", json.size());
everything_fine = false;
} else if ( starts_with("fail", name) and (not starts_with("fail10.json", name)) and !error) {
is_file_as_expected[i] = false;
printf("warning: file %s should fail but it passes.\n", name);
printf("size of file in bytes: %zu \n", json.size());
everything_fine = false;
} else if (starts_with("pass", name) or starts_with("fail10.json", name) or starts_with("fail70.json", name)) {
if (error) {
is_file_as_expected[i] = false;
printf("warning: file %s should pass but it fails. Error is: %s\n",
name, error_message(error));
printf("size of file in bytes: %zu \n", json.size());
everything_fine = false;
}
} else if ( starts_with("fail", name) ) {
if (!error) {
is_file_as_expected[i] = false;
printf("warning: file %s should fail but it passes.\n", name);
printf("size of file in bytes: %zu \n", json.size());
everything_fine = false;
}
}
free(fullpath);
}