From b431f79db6deb75229748f80a3e9e448b6dacf31 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 3 Jul 2016 06:05:39 +0200 Subject: Revert "error: improved parser error reporting" this will not work properly for unicode chars This reverts commit 3968529cad2baec099acff5fee47b5fe24624b03. --- tests/check_error.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'tests/check_error.c') diff --git a/tests/check_error.c b/tests/check_error.c index a954095..8818b00 100644 --- a/tests/check_error.c +++ b/tests/check_error.c @@ -49,27 +49,21 @@ test_error_parser(void **state) assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 3, position 2:\n" - "chunda\n" - " ^"); + "asd 10\nError occurred near line 3, position 2: chunda"); blogc_error_free(error); a = "bola\nguda\nchunda"; error = blogc_error_parser(1, a, strlen(a), 11, "asd %d", 10); assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 3, position 2:\n" - "chunda\n" - " ^"); + "asd 10\nError occurred near line 3, position 2: chunda"); blogc_error_free(error); a = "bola\nguda\nchunda"; error = blogc_error_parser(1, a, strlen(a), 0, "asd %d", 10); assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 1, position 1:\n" - "bola\n" - "^"); + "asd 10\nError occurred near line 1, position 1: bola"); blogc_error_free(error); a = ""; error = blogc_error_parser(1, a, strlen(a), 0, "asd %d", 10); @@ -88,27 +82,21 @@ test_error_parser_crlf(void **state) assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 3, position 2:\n" - "chunda\n" - " ^"); + "asd 10\nError occurred near line 3, position 2: chunda"); blogc_error_free(error); a = "bola\r\nguda\r\nchunda"; error = blogc_error_parser(1, a, strlen(a), 13, "asd %d", 10); assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 3, position 2:\n" - "chunda\n" - " ^"); + "asd 10\nError occurred near line 3, position 2: chunda"); blogc_error_free(error); a = "bola\r\nguda\r\nchunda"; error = blogc_error_parser(1, a, strlen(a), 0, "asd %d", 10); assert_non_null(error); assert_int_equal(error->type, 1); assert_string_equal(error->msg, - "asd 10\nError occurred near line 1, position 1:\n" - "bola\n" - "^"); + "asd 10\nError occurred near line 1, position 1: bola"); blogc_error_free(error); } -- cgit v1.2.3-18-g5258