mirror of https://github.com/tstack/lnav.git
[formats] fix error message if pattern does not fully match sample
This commit is contained in:
parent
e2e491ec41
commit
c17046b2fa
|
@ -477,6 +477,20 @@ h6(S str)
|
|||
|
||||
namespace literals {
|
||||
|
||||
inline std::pair<std::string, string_attr_pair> operator"" _ok(const char* str,
|
||||
std::size_t len)
|
||||
{
|
||||
return std::make_pair(std::string(str, len),
|
||||
VC_ROLE.template value(role_t::VCR_OK));
|
||||
}
|
||||
|
||||
inline std::pair<std::string, string_attr_pair> operator"" _error(
|
||||
const char* str, std::size_t len)
|
||||
{
|
||||
return std::make_pair(std::string(str, len),
|
||||
VC_ROLE.template value(role_t::VCR_ERROR));
|
||||
}
|
||||
|
||||
inline std::pair<std::string, string_attr_pair> operator"" _info(
|
||||
const char* str, std::size_t len)
|
||||
{
|
||||
|
|
|
@ -1945,7 +1945,7 @@ external_log_format::build(std::vector<lnav::console::user_message>& errors)
|
|||
pat_iter != this->elf_pattern_order.end() && !found;
|
||||
++pat_iter)
|
||||
{
|
||||
pattern& pat = *(*pat_iter);
|
||||
auto& pat = *(*pat_iter);
|
||||
|
||||
if (!pat.p_pcre) {
|
||||
continue;
|
||||
|
@ -2094,22 +2094,57 @@ external_log_format::build(std::vector<lnav::console::user_message>& errors)
|
|||
pcre_context_static<128> pc_full;
|
||||
pcre_input pi_full(elf_sample.s_line.pp_value);
|
||||
|
||||
if (!pat.p_pcre->match(pc_full, pi_full)
|
||||
|| static_cast<size_t>(pc_full.all()->length())
|
||||
!= elf_sample.s_line.pp_value.length())
|
||||
{
|
||||
if (!pat.p_pcre->match(pc_full, pi_full)) {
|
||||
attr_line_t regex_al = pat.p_pcre->get_pattern();
|
||||
lnav::snippets::regex_highlighter(
|
||||
regex_al, -1, line_range{0, (int) regex_al.length()});
|
||||
errors.emplace_back(
|
||||
lnav::console::user_message::error(
|
||||
attr_line_t("invalid pattern: ")
|
||||
.append_quoted(lnav::roles::symbol(
|
||||
pat.p_name.to_string())))
|
||||
.with_reason("pattern does not match entire "
|
||||
"multiline message")
|
||||
"multiline sample message")
|
||||
.with_snippet(elf_sample.s_line.to_snippet())
|
||||
.with_help(attr_line_t("using ")
|
||||
.append_quoted(".*")
|
||||
.append(" when capturing the body "
|
||||
"will match new-lines")));
|
||||
.with_note(attr_line_t()
|
||||
.append(lnav::roles::symbol(
|
||||
pat.p_name.to_string()))
|
||||
.append(" = ")
|
||||
.append(regex_al))
|
||||
.with_help(
|
||||
attr_line_t("use ").append_quoted(".*").append(
|
||||
" to match new-lines")));
|
||||
} else if (static_cast<size_t>(pc_full.all()->length())
|
||||
!= elf_sample.s_line.pp_value.length())
|
||||
{
|
||||
attr_line_t regex_al = pat.p_pcre->get_pattern();
|
||||
lnav::snippets::regex_highlighter(
|
||||
regex_al, -1, line_range{0, (int) regex_al.length()});
|
||||
auto match_length
|
||||
= static_cast<size_t>(pc_full.all()->length());
|
||||
attr_line_t sample_al = elf_sample.s_line.pp_value;
|
||||
sample_al.append("\n")
|
||||
.append(match_length, ' ')
|
||||
.append("^ matched up to here"_error)
|
||||
.with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
auto sample_snippet = lnav::console::snippet::from(
|
||||
elf_sample.s_line.pp_location, sample_al);
|
||||
errors.emplace_back(
|
||||
lnav::console::user_message::error(
|
||||
attr_line_t("invalid pattern: ")
|
||||
.append_quoted(lnav::roles::symbol(
|
||||
pat.p_name.to_string())))
|
||||
.with_reason("pattern does not match entire "
|
||||
"message")
|
||||
.with_snippet(sample_snippet)
|
||||
.with_note(attr_line_t()
|
||||
.append(lnav::roles::symbol(
|
||||
pat.p_name.to_string()))
|
||||
.append(" = ")
|
||||
.append(regex_al))
|
||||
.with_help("update the regular expression to fully "
|
||||
"capture the sample message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,7 +125,8 @@ yajl_cleanup_tree(yajl_val val)
|
|||
|
||||
yajl_cleanup_tree(child_val);
|
||||
if (YAJL_IS_OBJECT(child_val)
|
||||
&& YAJL_GET_OBJECT(child_val)->len == 0) {
|
||||
&& YAJL_GET_OBJECT(child_val)->len == 0)
|
||||
{
|
||||
free((char*) val_as_obj->keys[lpc]);
|
||||
yajl_tree_free(val_as_obj->values[lpc]);
|
||||
val_as_obj->len -= 1;
|
||||
|
@ -312,7 +313,8 @@ json_path_handler_base::gen_schema(yajlpp_gen_context& ygc) const
|
|||
schema.gen("type");
|
||||
if (this->jph_is_array) {
|
||||
if (this->jph_regex->p_pattern.find("#?")
|
||||
== std::string::npos) {
|
||||
== std::string::npos)
|
||||
{
|
||||
schema.gen("array");
|
||||
} else {
|
||||
yajlpp_array type_array(ygc.ygc_handle);
|
||||
|
@ -610,7 +612,8 @@ yajlpp_parse_context::map_start(void* ctx)
|
|||
ypc->ypc_path_index_stack.push_back(ypc->ypc_path.size() - 1);
|
||||
|
||||
if (ypc->ypc_path.size() > 1
|
||||
&& ypc->ypc_path[ypc->ypc_path.size() - 2] == '#') {
|
||||
&& ypc->ypc_path[ypc->ypc_path.size() - 2] == '#')
|
||||
{
|
||||
ypc->ypc_array_index.back() += 1;
|
||||
}
|
||||
|
||||
|
@ -695,7 +698,8 @@ yajlpp_parse_context::update_callbacks(const json_path_container* orig_handlers,
|
|||
std::string curr_path(&this->ypc_path[0], this->ypc_path.size() - 1);
|
||||
|
||||
if (this->ypc_active_paths.find(curr_path)
|
||||
== this->ypc_active_paths.end()) {
|
||||
== this->ypc_active_paths.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -736,14 +740,16 @@ yajlpp_parse_context::update_callbacks(const json_path_container* orig_handlers,
|
|||
this->ypc_handler_stack.emplace_back(&jph);
|
||||
|
||||
if (1 + child_start + cap->c_end
|
||||
!= (int) this->ypc_path.size() - 1) {
|
||||
!= (int) this->ypc_path.size() - 1)
|
||||
{
|
||||
this->update_callbacks(jph.jph_children,
|
||||
1 + child_start + cap->c_end);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (1 + child_start + cap->c_end
|
||||
!= (int) this->ypc_path.size() - 1) {
|
||||
!= (int) this->ypc_path.size() - 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1437,17 +1443,18 @@ json_path_handler_base::report_regex_value_error(
|
|||
pcre_error_content.append("\n")
|
||||
.append(pcre_error.ce_offset, ' ')
|
||||
.append(lnav::roles::error("^ "))
|
||||
.append(lnav::roles::error(pcre_error.ce_msg));
|
||||
.append(lnav::roles::error(pcre_error.ce_msg))
|
||||
.with_attr_for_all(VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
ypc->report_error(lnav::console::user_message::error(
|
||||
attr_line_t()
|
||||
.append_quoted(value)
|
||||
.append(" is not a valid regular expression for "
|
||||
"property ")
|
||||
.append_quoted(
|
||||
lnav::roles::symbol(ypc->get_full_path().to_string())))
|
||||
.with_reason(pcre_error.ce_msg)
|
||||
.with_snippet(ypc->get_snippet())
|
||||
.with_snippet(lnav::console::snippet::from(
|
||||
.append_quoted(lnav::roles::symbol(
|
||||
ypc->get_full_path().to_string())))
|
||||
.with_reason(pcre_error.ce_msg)
|
||||
.with_snippet(ypc->get_snippet())
|
||||
.with_snippet(lnav::console::snippet::from(
|
||||
ypc->get_full_path(), pcre_error_content))
|
||||
.with_help(this->get_help_text(ypc)));
|
||||
}
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
"regex": {
|
||||
"std": {
|
||||
"pattern": "^(?<timestamp>\\d+: (?<body>.*)$"
|
||||
},
|
||||
"incomplete-match": {
|
||||
"pattern": "^(?<timestamp>\\d+);"
|
||||
}
|
||||
},
|
||||
"level" : {
|
||||
"error" : "(foo"
|
||||
"level": {
|
||||
"error": "(foo"
|
||||
},
|
||||
"timestamp-format" : [
|
||||
"timestamp-format": [
|
||||
"%i"
|
||||
],
|
||||
"sample": [
|
||||
|
|
|
@ -232,6 +232,8 @@ EXPECTED_FILES = \
|
|||
$(srcdir)/%reldir%/test_events.sh_ed8dc44add223341c03ccb7b3e18371bdb42b710.out \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_15e861d2327512a721fd42ae51dc5427689e0bb6.err \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_15e861d2327512a721fd42ae51dc5427689e0bb6.out \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_3f1d6f35e8a9ae4fd3e91ffaa82a037b5a847ab7.err \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_3f1d6f35e8a9ae4fd3e91ffaa82a037b5a847ab7.out \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_a47f2b090a5d8a226783835c7ff7d1c8821f11ed.err \
|
||||
$(srcdir)/%reldir%/test_format_loader.sh_a47f2b090a5d8a226783835c7ff7d1c8821f11ed.out \
|
||||
$(srcdir)/%reldir%/test_json_format.sh_168cac40c27f547044c89d39eb0ff2ef81da4b21.err \
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
[1m[31m✘ error[0m: “abc(def” is not a valid regular expression for property “[1m/invalid_props_log/search-table/bad_table_regex/pattern[0m”
|
||||
[1m[31mreason[0m: missing )
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:24
|
||||
[36m | [0m[37m[40m "pattern": "abc(def" [0m
|
||||
[36m --> [0m[1m/invalid_props_log/search-table/bad_table_regex/pattern[0m
|
||||
[36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40mdef [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing )[0m[37m[40m [0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/invalid_props_log/search-table/bad_table_regex/pattern[0m [4m<regex>[0m
|
||||
[1mDescription[0m
|
||||
The regular expression for this search table.
|
||||
[1m[31m✘ error[0m: “^(?<timestamp>\d+: (?<body>.*)$” is not a valid regular expression for property “[1m/bad_regex_log/regex/std/pattern[0m”
|
||||
[1m[31mreason[0m: missing )
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:6
|
||||
[36m | [0m[37m[40m "pattern": "^(?<timestamp>\\d+: (?<body>.*)$"[0m
|
||||
[36m --> [0m[1m/bad_regex_log/regex/std/pattern[0m
|
||||
[36m | [0m[1m[36m[40m^[0m[1m[7m[32m[40m([0m[1m[32m[40m?[0m[1m[36m[40m<[0m[37m[40mtimestamp>[0m[1m[37m[40m\d[0m[1m[36m[40m+[0m[37m[40m: [0m[1m[32m[40m([0m[1m[32m[40m?[0m[1m[36m[40m<[0m[37m[40mbody>[0m[1m[36m[40m.[0m[1m[36m[40m*[0m[1m[32m[40m)[0m[1m[36m[40m$[0m[37m[40m [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing )[0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/bad_regex_log/regex/std/pattern[0m [4m<message-regex>[0m
|
||||
[1mDescription[0m
|
||||
The regular expression to match a log message and capture fields.
|
||||
[1m[31m✘ error[0m: “(foo” is not a valid regular expression for property “[1m/bad_regex_log/level/error[0m”
|
||||
[1m[31mreason[0m: missing )
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:13
|
||||
[36m | [0m[37m[40m "error": "(foo" [0m
|
||||
[36m --> [0m[1m/bad_regex_log/level/error[0m
|
||||
[36m | [0m[1m[7m[32m[40m([0m[37m[40mfoo [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing )[0m[37m[40m [0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/bad_regex_log/level/error[0m [4m<pattern|integer>[0m
|
||||
[1mDescription[0m
|
||||
The regular expression used to match the log text for this level. For JSON logs with numeric levels, this should be the number for the corresponding level.
|
||||
[1m[31m✘ error[0m: “abc(” is not a valid regular expression for property “[1m/bad_regex_log/highlights/foobar/pattern[0m”
|
||||
[1m[31mreason[0m: missing )
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:25
|
||||
[36m | [0m[37m[40m "pattern": "abc(" [0m
|
||||
[36m --> [0m[1m/bad_regex_log/highlights/foobar/pattern[0m
|
||||
[36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40m [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing )[0m[37m[40m [0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/bad_regex_log/highlights/foobar/pattern[0m [4m<regex>[0m
|
||||
[1mDescription[0m
|
||||
A regular expression to highlight in logs of this format.
|
||||
[1m[31m✘ error[0m: “foo” is not a valid value for option “[1m/bad_sample_log/value/pid/kind[0m”
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:24
|
||||
[36m | [0m[37m[40m "kind": "foo" [0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/bad_sample_log/value/pid/kind[0m [4m<data-type>[0m
|
||||
[1mDescription[0m
|
||||
The type of data in the field
|
||||
[1mAllowed Values[0m
|
||||
[1mstring[0m, [1minteger[0m, [1mfloat[0m, [1mboolean[0m, [1mjson[0m, [1mstruct[0m, [1mquoted[0m, [1mxml[0m
|
||||
[1m[31m✘ error[0m: '[1mbad[0m' is not a supported log format $schema version
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-schema/format.json[0m:2
|
||||
[36m | [0m[37m[40m "$schema": "bad" [0m
|
||||
[36m =[0m [36mnote[0m: expecting one of the following $schema values:
|
||||
[1m https://lnav.org/schemas/format-v1.schema.json[0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/$schema[0m [4mThe URI of the schema for this file[0m
|
||||
[1mDescription[0m
|
||||
Specifies the type of this file
|
||||
[1m[31m✘ error[0m: invalid pattern: “[1mincomplete-match[0m”
|
||||
[1m[31mreason[0m: pattern does not match entire message
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:20
|
||||
[36m | [0m[37m[40m1428634687123; foo [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ matched up to here[0m[37m[40m [0m
|
||||
[36m =[0m [36mnote[0m: [1mincomplete-match[0m = [1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m;
|
||||
[36m =[0m [36mhelp[0m: update the regular expression to fully capture the sample message
|
||||
[1m[31m✘ error[0m: invalid sample log message: "abc: foo"
|
||||
[1m[31mreason[0m: unrecognized timestamp -- abc
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:30
|
||||
[36m =[0m [36mnote[0m: the following custom formats were tried:
|
||||
abc
|
||||
[36m^ [0m“[1m%i[0m”[36m matched up to here[0m
|
||||
[36m =[0m [36mhelp[0m: If the timestamp format is not supported by default, you can add a custom format with the “[1mtimestamp-format[0m” property
|
||||
[1m[31m✘ error[0m: invalid sample log message: "1428634687123| debug hello"
|
||||
[1m[31mreason[0m: “[1mdebug[0m” does not match the expected level of “[1minfo[0m”
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:33
|
||||
[36m =[0m [36mnote[0m: matched regex = [1mwith-level[0m
|
||||
captured level = “debug”
|
||||
[1m[31m✘ error[0m: invalid pattern: “[1mwith-level[0m”
|
||||
[1m[31mreason[0m: pattern does not match entire multiline sample message
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:37
|
||||
[36m =[0m [36mnote[0m: [1mwith-level[0m = [1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m\| [1m[32m([0m[1m[32m?[0m[1m[36m<[0mlevel>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m
|
||||
[36m =[0m [36mhelp[0m: use “.*” to match new-lines
|
||||
[1m[31m✘ error[0m: invalid sample log message: "1428634687123; foo bar"
|
||||
[1m[31mreason[0m: sample does not match any patterns
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:41
|
||||
[36m =[0m [36mnote[0m: the following shows how each pattern matched this sample:
|
||||
1428634687123; foo bar
|
||||
[36m^ [0m[1mbad-time[0m[36m matched up to here[0m
|
||||
[36m^ [0m[1msemi[0m[36m matched up to here[0m
|
||||
[36m^ [0m[1mstd[0m[36m matched up to here[0m
|
||||
[36m^ [0m[1mwith-level[0m[36m matched up to here[0m
|
||||
[36m =[0m [36mnote[0m: [1mbad-time [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\w[0m[1m[36m+[0m[1m[32m)[0m: [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
[1msemi [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m; [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
[1mstd [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m: [1m[32m([0m[1m[32m?[0m[1m[36m<[0mpid>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m[36m.[0m[1m[36m*[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
[1mwith-level[0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m\| [1m[32m([0m[1m[32m?[0m[1m[36m<[0mlevel>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
|
||||
[1m[31m✘ error[0m: invalid value for property “[1m/invalid_props_log/timestamp-field[0m”
|
||||
[1m[31mreason[0m: “ts” was not found in the pattern at [1m/invalid_props_log/regex/std[0m
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
|
||||
[36m =[0m [36mnote[0m: the following captures are available:
|
||||
[1mbody[0m, [1mpid[0m, [1mtimestamp[0m
|
||||
[1m[31m✘ error[0m: “not a color” is not a valid color value for property “[1m/invalid_props_log/highlights/hl1/color[0m”
|
||||
[1m[31mreason[0m: Unknown color: 'not a color'. See https://jonasjacek.github.io/colors/ for a list of supported color names
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:18
|
||||
[1m[31m✘ error[0m: “also not a color” is not a valid color value for property “[1m/invalid_props_log/highlights/hl1/background-color[0m”
|
||||
[1m[31mreason[0m: Unknown color: 'also not a color'. See https://jonasjacek.github.io/colors/ for a list of supported color names
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:19
|
||||
[1m[31m✘ error[0m: “[1mno_regexes_log[0m” is not a valid log format
|
||||
[1m[31mreason[0m: no regexes specified
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/no-regexes/format.json[0m:4
|
||||
[1m[31m✘ error[0m: “[1mno_regexes_log[0m” is not a valid log format
|
||||
[1m[31mreason[0m: log message samples must be included in a format definition
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/no-regexes/format.json[0m:4
|
||||
[1m[31m✘ error[0m: “[1mno_sample_log[0m” is not a valid log format
|
||||
[1m[31mreason[0m: log message samples must be included in a format definition
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/no-samples/format.json[0m:4
|
||||
[1m[31m✘ error[0m: failed to compile SQL statement
|
||||
[1m[31mreason[0m: near "TALE": syntax error
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sql/init.sql[0m:4
|
||||
[36m | [0m[32m[40m-- comment test [0m
|
||||
[36m | [0m[1m[36m[40mCREATE[0m[37m[40m [0m[37m[40mTALE[0m[37m[40m [0m[1m[37m[40minvalid[0m[1m[37m[40m [0m[37m[40m([0m[37m[40mx[0m[37m[40m [0m[37m[40my[0m[37m[40m [0m[37m[40mz[0m[37m[40m); [0m
|
||||
[36m | [0m[37m[40m [0m[36m[40m^ [0m[1m[31m[40mnear "TALE": syntax error[0m[37m[40m [0m
|
||||
[1m[31m✘ error[0m: failed to execute SQL statement
|
||||
[1m[31mreason[0m: lnav-error:{"level":"error","message":{"str":"call to regexp_match(re, str) failed","attrs":[{"start":8,"end":20,"type":"role","value":46},{"start":21,"end":23,"type":"role","value":45},{"start":25,"end":28,"type":"role","value":45},{"start":8,"end":29,"type":"role","value":59}]},"reason":{"str":"missing )","attrs":[]},"snippets":[],"help":{"str":"","attrs":[]}}
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sql/init2.sql[0m
|
||||
[36m | [0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mregexp_match[0m[1m[7m[31m[40m([0m[35m[40m'abc('[0m[37m[40m, [0m[35m[40m'123'[0m[37m[40m) [0m
|
||||
[36m | [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40msqlite_master[0m[37m[40m; [0m
|
|
@ -9,8 +9,8 @@
|
|||
[36m --> [0m[1m{test_dir}/bad-config-json/formats/invalid-key/format.json[0m:4
|
||||
[36m | [0m[37m[40m "level-pointer": "abc(", [0m
|
||||
[36m --> [0m[1m/invalid_key_log/level-pointer[0m
|
||||
[36m | [0mabc[1m[7m[32m([0m
|
||||
[36m | [0m [1m[31m^ [0m[1m[31mmissing )[0m
|
||||
[36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40m [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing )[0m[37m[40m [0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/invalid_key_log/level-pointer[0m
|
||||
[1mDescription[0m
|
||||
|
@ -20,8 +20,8 @@
|
|||
[36m --> [0m[1m{test_dir}/bad-config-json/formats/invalid-key/format.json[0m:5
|
||||
[36m | [0m[37m[40m "file-pattern": "def[ghi", [0m
|
||||
[36m --> [0m[1m/invalid_key_log/file-pattern[0m
|
||||
[36m | [0mdef[1m[7m[32m[[0mghi
|
||||
[36m | [0m [1m[31m^ [0m[1m[31mmissing terminating ] for character class[0m
|
||||
[36m | [0m[37m[40mdef[0m[1m[7m[32m[40m[[0m[37m[40mghi [0m
|
||||
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing terminating ] for character class[0m
|
||||
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
|
||||
[1m/invalid_key_log/file-pattern[0m
|
||||
[1mDescription[0m
|
||||
|
|
|
@ -5,7 +5,7 @@ export YES_COLOR=1
|
|||
run_cap_test ${lnav_test} -C \
|
||||
-I ${test_dir}/bad-config-json
|
||||
|
||||
if x"$HAVE_SQLITE3_ERROR_OFFSET" != x""; then
|
||||
if test x"$HAVE_SQLITE3_ERROR_OFFSET" != x""; then
|
||||
run_cap_test env LC_ALL=C ${lnav_test} -C \
|
||||
-I ${test_dir}/bad-config
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue