From 1e23402eb23adf4ecd6c1c6bc83ecf21c8e0a6cd Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 13 Nov 2016 16:59:14 -0800 Subject: Change status_end_element_mismatch to point to closing tag name Previously the error offset pointed to the first mismatching character, which can be confusing especially if the start tag name is a prefix of the end tag name. Instead, move the offset to the first character of the name - that way it should be more obvious that the problem is that the entire name mismatches. Fixes #112. --- tests/test_parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_parse.cpp') diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp index f199eb9..ba45a45 100644 --- a/tests/test_parse.cpp +++ b/tests/test_parse.cpp @@ -1005,8 +1005,8 @@ TEST(parse_error_offset) CHECK_OFFSET("", parse_default, status_bad_end_element, 7); CHECK_OFFSET("", parse_default, status_end_element_mismatch, 8); - CHECK_OFFSET("", parse_default, status_end_element_mismatch, 9); + CHECK_OFFSET("", parse_default, status_end_element_mismatch, 6); + CHECK_OFFSET("", parse_default, status_end_element_mismatch, 6); } TEST(parse_result_default) -- cgit v1.2.3