aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/check_error.c')
-rw-r--r--tests/check_error.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/check_error.c b/tests/check_error.c
index 8818b00..a954095 100644
--- a/tests/check_error.c
+++ b/tests/check_error.c
@@ -49,21 +49,27 @@ 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: chunda");
+ "asd 10\nError occurred near line 3, position 2:\n"
+ "chunda\n"
+ " ^");
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: chunda");
+ "asd 10\nError occurred near line 3, position 2:\n"
+ "chunda\n"
+ " ^");
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: bola");
+ "asd 10\nError occurred near line 1, position 1:\n"
+ "bola\n"
+ "^");
blogc_error_free(error);
a = "";
error = blogc_error_parser(1, a, strlen(a), 0, "asd %d", 10);
@@ -82,21 +88,27 @@ 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: chunda");
+ "asd 10\nError occurred near line 3, position 2:\n"
+ "chunda\n"
+ " ^");
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: chunda");
+ "asd 10\nError occurred near line 3, position 2:\n"
+ "chunda\n"
+ " ^");
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: bola");
+ "asd 10\nError occurred near line 1, position 1:\n"
+ "bola\n"
+ "^");
blogc_error_free(error);
}