Update some tests

This commit is contained in:
ridiculousfish 2013-11-26 00:01:23 -08:00
parent 2a1fd421bd
commit f2211ff3ad

View file

@ -2002,10 +2002,12 @@ static void test_new_parser_fuzzing(void)
{ {
say(L"Fuzzing parser (node size: %lu)", sizeof(parse_node_t)); say(L"Fuzzing parser (node size: %lu)", sizeof(parse_node_t));
double start = timef(); double start = timef();
bool log_it = false;
// ensure nothing crashes // ensure nothing crashes
size_t max = 5; size_t max = 4;
for (size_t len=1; len <= max; len++) for (size_t len=1; len <= max; len++)
{ {
if (log_it)
fprintf(stderr, "%lu / %lu...", len, max); fprintf(stderr, "%lu / %lu...", len, max);
std::vector<parser_fuzz_token_t> tokens(len); std::vector<parser_fuzz_token_t> tokens(len);
size_t count = 0; size_t count = 0;
@ -2025,9 +2027,11 @@ static void test_new_parser_fuzzing(void)
// keep going until we wrap // keep going until we wrap
} }
while (! increment(tokens)); while (! increment(tokens));
if (log_it)
fprintf(stderr, "done (%lu)\n", count); fprintf(stderr, "done (%lu)\n", count);
} }
double end = timef(); double end = timef();
if (log_it)
say(L"All fuzzed in %f seconds!", end - start); say(L"All fuzzed in %f seconds!", end - start);
} }
@ -2266,6 +2270,9 @@ static void test_highlighting(void)
const highlight_component_t components9[] = const highlight_component_t components9[] =
{ {
{L"end", HIGHLIGHT_ERROR},
{L";", HIGHLIGHT_END},
{L"if", HIGHLIGHT_COMMAND},
{L"end", HIGHLIGHT_ERROR}, {L"end", HIGHLIGHT_ERROR},
{NULL, -1} {NULL, -1}
}; };
@ -2346,7 +2353,7 @@ int main(int argc, char **argv)
if (should_test_function("highlighting")) test_highlighting(); if (should_test_function("highlighting")) test_highlighting();
if (should_test_function("new_parser_ll2")) test_new_parser_ll2(); if (should_test_function("new_parser_ll2")) test_new_parser_ll2();
//if (should_test_function("new_parser_fuzzing")) test_new_parser_fuzzing(); //fuzzing is expensive if (should_test_function("new_parser_fuzzing")) test_new_parser_fuzzing(); //fuzzing is expensive
if (should_test_function("new_parser_correctness")) test_new_parser_correctness(); if (should_test_function("new_parser_correctness")) test_new_parser_correctness();
if (should_test_function("new_parser")) test_new_parser(); if (should_test_function("new_parser")) test_new_parser();
if (should_test_function("escape")) test_unescape_sane(); if (should_test_function("escape")) test_unescape_sane();