diff options
author | Tina Müller <cpan2@tinita.de> | 2020-05-17 14:43:57 +0200 |
---|---|---|
committer | Tina Müller <cpan2@tinita.de> | 2020-05-21 14:50:20 +0200 |
commit | fec20d3fe68ef3cf521a7bf55f95739fd752d26f (patch) | |
tree | 74924259834d5e19337a48b8491fb03a9217b3e3 | |
parent | 72e2f75277ff88ad1fb8a81cf422df06bf371578 (diff) | |
download | libyaml-git-fec20d3fe68ef3cf521a7bf55f95739fd752d26f.tar.gz |
Output error position in run-parser-test-suite.c
-rw-r--r-- | tests/run-parser-test-suite.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/run-parser-test-suite.c b/tests/run-parser-test-suite.c index b2c7f84..776d379 100644 --- a/tests/run-parser-test-suite.c +++ b/tests/run-parser-test-suite.c @@ -30,7 +30,15 @@ int main(int argc, char *argv[]) while (1) { yaml_event_type_t type; if (!yaml_parser_parse(&parser, &event)) { - fprintf(stderr, "Parse error: %s\n", parser.problem); + if ( parser.problem_mark.line || parser.problem_mark.column ) { + fprintf(stderr, "Parse error: %s\nLine: %lu Column: %lu\n", + parser.problem, + (unsigned long)parser.problem_mark.line + 1, + (unsigned long)parser.problem_mark.column + 1); + } + else { + fprintf(stderr, "Parse error: %s\n", parser.problem); + } return 1; } type = event.type; |