From 190bc1e33aa3902f7cbd53d7de5c807456009563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 31 May 2011 09:03:52 +0200 Subject: [PATCH] Update testsuite following update of exceptions Exceptions were modified: o The message doesn't end with "\n" anymore. o The invalid option exception format now reflects the common format. --- testsuite/data/parsing/enc_invalid_unicode.pattern | 2 +- .../parsing/ex_5.10_reserved_indicators.pattern | 4 ++-- .../ex_5.14_invalid_escaped_characters.pattern | 4 ++-- .../parsing/ex_6.13_reserved_directives.pattern | 2 +- .../data/parsing/ex_6.14_yaml_directive.pattern | 2 +- .../ex_6.15_invalid_repeated_yaml_directive.pattern | 2 +- .../ex_6.17_invalid_repeated_tag_directive.pattern | 2 +- .../parsing/ex_6.25.invalid_verbatim_tags.pattern | 4 ++-- .../parsing/ex_6.27_invalid_tag_shorthands.pattern | 4 ++-- .../parsing/ex_7.22_invalid_implicit_keys.pattern | 4 ++-- ...id_block_scalar_indentation_indicators_1.pattern | 2 +- ...id_block_scalar_indentation_indicators_2.pattern | 2 +- ...id_block_scalar_indentation_indicators_3.pattern | 2 +- .../data/parsing/ex_9.4_explicit_documents.pattern | 2 +- testsuite/data/parsing/flow_mapping_empty_2.pattern | 2 +- .../data/parsing/flow_mapping_no_entry_1.pattern | 2 +- .../parsing/non_ascii_line_breaks_yaml12.pattern | 6 +++--- .../data/parsing/option_doc_version_invalid.pattern | 13 +++++++------ .../parsing/option_doc_version_too_high.pattern | 2 +- .../data/parsing/option_doc_version_too_low.pattern | 2 +- .../parsing/option_io_blocksize_invalid.pattern | 13 +++++++------ .../data/parsing/option_token_fun_invalid.pattern | 13 +++++++------ .../parsing/unsupported_yaml_version_13.pattern | 2 +- .../parsing/unsupported_yaml_version_20.pattern | 2 +- 24 files changed, 49 insertions(+), 46 deletions(-) diff --git a/testsuite/data/parsing/enc_invalid_unicode.pattern b/testsuite/data/parsing/enc_invalid_unicode.pattern index c50bee8..8046fe2 100644 --- a/testsuite/data/parsing/enc_invalid_unicode.pattern +++ b/testsuite/data/parsing/enc_invalid_unicode.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,undefined,undefined,error, - invalid_unicode, "Invalid Unicode character at byte #4\n", undefined, + invalid_unicode, "Invalid Unicode character at byte #4", undefined, [{byte,4}]} ], [ diff --git a/testsuite/data/parsing/ex_5.10_reserved_indicators.pattern b/testsuite/data/parsing/ex_5.10_reserved_indicators.pattern index ca7ec55..41a0e34 100644 --- a/testsuite/data/parsing/ex_5.10_reserved_indicators.pattern +++ b/testsuite/data/parsing/ex_5.10_reserved_indicators.pattern @@ -40,10 +40,10 @@ false, [ {yaml_parser_error,2,15,warning,reserved_indicator, - "The reserved indicator \"`\" is not allowed at the beginning of a plain scalar\n", + "The reserved indicator \"`\" is not allowed at the beginning of a plain scalar", undefined,[]}, {yaml_parser_error,1,16,warning,reserved_indicator, - "The reserved indicator \"@\" is not allowed at the beginning of a plain scalar\n", + "The reserved indicator \"@\" is not allowed at the beginning of a plain scalar", undefined,[]} ], [ diff --git a/testsuite/data/parsing/ex_5.14_invalid_escaped_characters.pattern b/testsuite/data/parsing/ex_5.14_invalid_escaped_characters.pattern index 6011568..4b83bb9 100644 --- a/testsuite/data/parsing/ex_5.14_invalid_escaped_characters.pattern +++ b/testsuite/data/parsing/ex_5.14_invalid_escaped_characters.pattern @@ -40,11 +40,11 @@ false, [ {yaml_parser_error,3,3,warning,invalid_escaped_character, - "Invalid escaped character\n", + "Invalid escaped character", {yaml_scalar,2,3,{yaml_tag,2,3,{non_specific,"!"}},flow,double_quoted,"c "}, []}, {yaml_parser_error,2,4,warning,invalid_escaped_character, - "Invalid escaped character\n", + "Invalid escaped character", {yaml_scalar,2,3,{yaml_tag,2,3,{non_specific,"!"}},flow,double_quoted,""}, []} ], diff --git a/testsuite/data/parsing/ex_6.13_reserved_directives.pattern b/testsuite/data/parsing/ex_6.13_reserved_directives.pattern index 5f5e64b..22e719f 100644 --- a/testsuite/data/parsing/ex_6.13_reserved_directives.pattern +++ b/testsuite/data/parsing/ex_6.13_reserved_directives.pattern @@ -40,7 +40,7 @@ false, [ {yaml_parser_error,1,1,warning,reserved_directive, - "Reserved directive \"FOO\" ignored\n", + "Reserved directive \"FOO\" ignored", {yaml_reserved_directive,1,1,"FOO",["bar","baz"],2}, []} ], diff --git a/testsuite/data/parsing/ex_6.14_yaml_directive.pattern b/testsuite/data/parsing/ex_6.14_yaml_directive.pattern index c371086..1c0b79e 100644 --- a/testsuite/data/parsing/ex_6.14_yaml_directive.pattern +++ b/testsuite/data/parsing/ex_6.14_yaml_directive.pattern @@ -40,7 +40,7 @@ false, [ {yaml_parser_error,3,1,warning,version_not_supported, - "Version 1.3 not supported (maximum version 1.2); parsing may fail\n", + "Version 1.3 not supported (maximum version 1.2); parsing may fail", {yaml_doc_start,3,1,{1,3},_}, []} ], diff --git a/testsuite/data/parsing/ex_6.15_invalid_repeated_yaml_directive.pattern b/testsuite/data/parsing/ex_6.15_invalid_repeated_yaml_directive.pattern index 7cd7b54..89b9303 100644 --- a/testsuite/data/parsing/ex_6.15_invalid_repeated_yaml_directive.pattern +++ b/testsuite/data/parsing/ex_6.15_invalid_repeated_yaml_directive.pattern @@ -40,7 +40,7 @@ false, [ {yaml_parser_error,2,1,warning,multiple_yaml_directives, - "Multiple YAML directives found: the last one will be used\n", + "Multiple YAML directives found: the last one will be used", {yaml_yaml_directive,2,1,{1,1}}, []} ], diff --git a/testsuite/data/parsing/ex_6.17_invalid_repeated_tag_directive.pattern b/testsuite/data/parsing/ex_6.17_invalid_repeated_tag_directive.pattern index 58ae514..a64af79 100644 --- a/testsuite/data/parsing/ex_6.17_invalid_repeated_tag_directive.pattern +++ b/testsuite/data/parsing/ex_6.17_invalid_repeated_tag_directive.pattern @@ -41,7 +41,7 @@ [ {yaml_parser_error,2,1,warning, multiple_tag_handle_declarations, - "Multiple declarations of the same handle found: the last one will be used\n", + "Multiple declarations of the same handle found: the last one will be used", {yaml_tag_directive,2,1,"!","!foo"}, []} ], diff --git a/testsuite/data/parsing/ex_6.25.invalid_verbatim_tags.pattern b/testsuite/data/parsing/ex_6.25.invalid_verbatim_tags.pattern index e3836fc..acc398f 100644 --- a/testsuite/data/parsing/ex_6.25.invalid_verbatim_tags.pattern +++ b/testsuite/data/parsing/ex_6.25.invalid_verbatim_tags.pattern @@ -41,11 +41,11 @@ true, [ {yaml_parser_error,2,3,warning,invalid_uri, - "Invalid character in URI scheme\n", + "Invalid character in URI scheme", {yaml_tag,2,3,"$:?"}, []}, {yaml_parser_error,1,7,error,invalid_tag_handle, - "Local tag suffix mandatory\n", + "Local tag suffix mandatory", {yaml_tag,1,3,"!"}, []} ], diff --git a/testsuite/data/parsing/ex_6.27_invalid_tag_shorthands.pattern b/testsuite/data/parsing/ex_6.27_invalid_tag_shorthands.pattern index d4708f6..767f0ec 100644 --- a/testsuite/data/parsing/ex_6.27_invalid_tag_shorthands.pattern +++ b/testsuite/data/parsing/ex_6.27_invalid_tag_shorthands.pattern @@ -41,11 +41,11 @@ true, [ {yaml_parser_error,4,9,error,undeclared_tag_handle, - "Tag handle \"!h!\" never declared\n", + "Tag handle \"!h!\" never declared", {yaml_tag,4,3,"!h!bar"}, []}, {yaml_parser_error,3,6,error,invalid_tag_handle, - "Tag suffix mandatory\n", + "Tag suffix mandatory", {yaml_tag,3,3,"!e!"}, []} ], diff --git a/testsuite/data/parsing/ex_7.22_invalid_implicit_keys.pattern b/testsuite/data/parsing/ex_7.22_invalid_implicit_keys.pattern index a4b554e..875d57f 100644 --- a/testsuite/data/parsing/ex_7.22_invalid_implicit_keys.pattern +++ b/testsuite/data/parsing/ex_7.22_invalid_implicit_keys.pattern @@ -40,10 +40,10 @@ false, [ {yaml_parser_error,4,2,warning,invalid_implicit_key, - "An implicit key must not take more than 1024 characters\n", + "An implicit key must not take more than 1024 characters", undefined,[]}, {yaml_parser_error,1,3,warning,invalid_implicit_key, - "An implicit key must not span several lines\n", + "An implicit key must not span several lines", undefined,[]} ], [ diff --git a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_1.pattern b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_1.pattern index f2a3d63..85e7573 100644 --- a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_1.pattern +++ b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_1.pattern @@ -41,7 +41,7 @@ [ {yaml_parser_error,3,2,warning, leading_empty_lines_too_long, - "A leading all-space line has too many spaces (2) compared to detected indentation (1)\n", + "A leading all-space line has too many spaces (2) compared to detected indentation (1)", {yaml_scalar,1,3,{yaml_tag,1,3,{non_specific,"!"}},block,literal,[]}, []} ], diff --git a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_2.pattern b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_2.pattern index 200b5f3..7aadf04 100644 --- a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_2.pattern +++ b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_2.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,3,2,error,invalid_block_scalar_indentation, - "Invalid block scalar indentation\n", + "Invalid block scalar indentation", {yaml_scalar,1,3,{yaml_tag,1,3,{non_specific,"!"}},block,folded,"text"}, []} ], diff --git a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_3.pattern b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_3.pattern index 7b1f9b5..6673d42 100644 --- a/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_3.pattern +++ b/testsuite/data/parsing/ex_8.3_invalid_block_scalar_indentation_indicators_3.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,2,2,error,invalid_block_scalar_indentation, - "Invalid block scalar indentation\n", + "Invalid block scalar indentation", {yaml_scalar,1,3,{yaml_tag,1,3,{non_specific,"!"}},block,literal,[]}, []} ], diff --git a/testsuite/data/parsing/ex_9.4_explicit_documents.pattern b/testsuite/data/parsing/ex_9.4_explicit_documents.pattern index 349224e..238e702 100644 --- a/testsuite/data/parsing/ex_9.4_explicit_documents.pattern +++ b/testsuite/data/parsing/ex_9.4_explicit_documents.pattern @@ -40,7 +40,7 @@ false, [ {yaml_parser_error,2,3,warning,invalid_implicit_key, - "An implicit key must not span several lines\n", + "An implicit key must not span several lines", undefined,[]} ], [ diff --git a/testsuite/data/parsing/flow_mapping_empty_2.pattern b/testsuite/data/parsing/flow_mapping_empty_2.pattern index 9fbec5a..e3daded 100644 --- a/testsuite/data/parsing/flow_mapping_empty_2.pattern +++ b/testsuite/data/parsing/flow_mapping_empty_2.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,2,1,error,flow_collection_entry_not_allowed, - "Empty flow collection entry not allowed\n",undefined,[]} + "Empty flow collection entry not allowed",undefined,[]} ], [ {yaml_stream_end,3,2}, diff --git a/testsuite/data/parsing/flow_mapping_no_entry_1.pattern b/testsuite/data/parsing/flow_mapping_no_entry_1.pattern index cdbbdbb..158a51f 100644 --- a/testsuite/data/parsing/flow_mapping_no_entry_1.pattern +++ b/testsuite/data/parsing/flow_mapping_no_entry_1.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,3,1,error,unpected_token, - "Unexpected \"yaml_scalar\" token following a \"yaml_scalar\" token\n", + "Unexpected \"yaml_scalar\" token following a \"yaml_scalar\" token", {yaml_scalar,3,1, {yaml_tag,3,1,{non_specific,"!"}}, flow,double_quoted,"item2"}, diff --git a/testsuite/data/parsing/non_ascii_line_breaks_yaml12.pattern b/testsuite/data/parsing/non_ascii_line_breaks_yaml12.pattern index d28c788..ec8ebb6 100644 --- a/testsuite/data/parsing/non_ascii_line_breaks_yaml12.pattern +++ b/testsuite/data/parsing/non_ascii_line_breaks_yaml12.pattern @@ -40,13 +40,13 @@ false, [ {yaml_parser_error,3,45,warning,non_ascii_line_break, - "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character\n", + "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character", undefined,[]}, {yaml_parser_error,3,25,warning,non_ascii_line_break, - "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character\n", + "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character", undefined,[]}, {yaml_parser_error,3,10,warning,non_ascii_line_break, - "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character\n", + "Use of non-ASCII line break is not supported anymore starting with YAML 1.2; treated as non-break character", undefined,[]} ], [ diff --git a/testsuite/data/parsing/option_doc_version_invalid.pattern b/testsuite/data/parsing/option_doc_version_invalid.pattern index 1de422a..18d468d 100644 --- a/testsuite/data/parsing/option_doc_version_invalid.pattern +++ b/testsuite/data/parsing/option_doc_version_invalid.pattern @@ -2,11 +2,12 @@ %% TEST ?_assertThrow( - {yaml_parser_error,undefined,undefined,error, - invalid_parser_option, - "Invalid value for option \"doc_version\": it must be a tuple of the form {Major, Minor} where Major and Minor are positive integers\n", - undefined, - [{option,{doc_version,invalid}}] - }, + {yaml_parser, + {yaml_parser_error,undefined,undefined,error, + invalid_parser_option, + "Invalid value for option \"doc_version\": it must be a tuple of the form {Major, Minor} where Major and Minor are positive integers", + undefined, + [{option,{doc_version,invalid}}] + }}, yaml_parser:file("${FILENAME}", [{doc_version, invalid}]) ) diff --git a/testsuite/data/parsing/option_doc_version_too_high.pattern b/testsuite/data/parsing/option_doc_version_too_high.pattern index cbb8270..b933923 100644 --- a/testsuite/data/parsing/option_doc_version_too_high.pattern +++ b/testsuite/data/parsing/option_doc_version_too_high.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,1,1,error,version_not_supported, - "Version 2.0 not supported (maximum version 1.2)\n", + "Version 2.0 not supported (maximum version 1.2)", {yaml_doc_start,1,1,{2,0},_}, []} ], diff --git a/testsuite/data/parsing/option_doc_version_too_low.pattern b/testsuite/data/parsing/option_doc_version_too_low.pattern index 9e5436f..bf923ca 100644 --- a/testsuite/data/parsing/option_doc_version_too_low.pattern +++ b/testsuite/data/parsing/option_doc_version_too_low.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,1,1,error,version_not_supported, - "Version 0.9 not supported (minimum version 1.1)\n", + "Version 0.9 not supported (minimum version 1.1)", {yaml_doc_start,1,1,{0,9},_}, []} ], diff --git a/testsuite/data/parsing/option_io_blocksize_invalid.pattern b/testsuite/data/parsing/option_io_blocksize_invalid.pattern index 15e7835..0ea2918 100644 --- a/testsuite/data/parsing/option_io_blocksize_invalid.pattern +++ b/testsuite/data/parsing/option_io_blocksize_invalid.pattern @@ -2,11 +2,12 @@ %% TEST ?_assertThrow( - {yaml_parser_error,undefined,undefined,error, - invalid_parser_option, - "Invalid value for option \"io_blocksize\": it must be a positive interger, expressed in bytes\n", - undefined, - [{option,{io_blocksize,invalid}}] - }, + {yaml_parser, + {yaml_parser_error,undefined,undefined,error, + invalid_parser_option, + "Invalid value for option \"io_blocksize\": it must be a positive interger, expressed in bytes", + undefined, + [{option,{io_blocksize,invalid}}] + }}, yaml_parser:file("${FILENAME}", [{io_blocksize, invalid}]) ) diff --git a/testsuite/data/parsing/option_token_fun_invalid.pattern b/testsuite/data/parsing/option_token_fun_invalid.pattern index 1bb20a0..3f53500 100644 --- a/testsuite/data/parsing/option_token_fun_invalid.pattern +++ b/testsuite/data/parsing/option_token_fun_invalid.pattern @@ -2,11 +2,12 @@ %% TEST ?_assertThrow( - {yaml_parser_error,undefined,undefined,error, - invalid_parser_option, - "Invalid value for option \"token_fun\": it must be a function taking the parser state as its sole argument\n", - undefined, - [{option,{token_fun,invalid}}] - }, + {yaml_parser, + {yaml_parser_error,undefined,undefined,error, + invalid_parser_option, + "Invalid value for option \"token_fun\": it must be a function taking the parser state as its sole argument", + undefined, + [{option,{token_fun,invalid}}] + }}, yaml_parser:string(<<>>, [{token_fun, invalid}]) ) diff --git a/testsuite/data/parsing/unsupported_yaml_version_13.pattern b/testsuite/data/parsing/unsupported_yaml_version_13.pattern index f3a3e5b..5187696 100644 --- a/testsuite/data/parsing/unsupported_yaml_version_13.pattern +++ b/testsuite/data/parsing/unsupported_yaml_version_13.pattern @@ -40,7 +40,7 @@ false, [ {yaml_parser_error,2,1,warning,version_not_supported, - "Version 1.3 not supported (maximum version 1.2); parsing may fail\n", + "Version 1.3 not supported (maximum version 1.2); parsing may fail", {yaml_doc_start,2,1,{1,3},_}, []} ], diff --git a/testsuite/data/parsing/unsupported_yaml_version_20.pattern b/testsuite/data/parsing/unsupported_yaml_version_20.pattern index f3d472e..2d01c29 100644 --- a/testsuite/data/parsing/unsupported_yaml_version_20.pattern +++ b/testsuite/data/parsing/unsupported_yaml_version_20.pattern @@ -41,7 +41,7 @@ true, [ {yaml_parser_error,2,1,error,version_not_supported, - "Version 2.0 not supported (maximum version 1.2)\n", + "Version 2.0 not supported (maximum version 1.2)", {yaml_doc_start,2,1,{2,0},_}, []} ],