Skip to content

Commit

Permalink
add new canst to not to break existing test suits
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <[email protected]>
  • Loading branch information
ganmacs committed Mar 3, 2020
1 parent 7b09ffb commit 50a10cb
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions test/plugin/test_in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,29 @@ def cleanup_directory(path)
MULTILINE_CONFIG = config_element(
"", "", {
"format" => "multiline",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>.[^\\n]+))?/",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>.*))?/",
"format_firstline" => "/^[s]/"
})
PARSE_MULTILINE_CONFIG = config_element(
"", "", {},
[config_element("parse", "", {
"@type" => "multiline",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>[^\\n]+))?/",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>.*))?/",
"format_firstline" => "/^[s]/"
})
])

MULTILINE_CONFIG_WITH_NEWLINE = config_element(
"", "", {
"format" => "multiline",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>.[^\\n]+))?/",
"format_firstline" => "/^[s]/"
})
PARSE_MULTILINE_CONFIG_WITH_NEWLINE = config_element(
"", "", {},
[config_element("parse", "", {
"@type" => "multiline",
"format1" => "/^s (?<message1>[^\\n]+)(\\nf (?<message2>[^\\n]+))?(\\nf (?<message3>.[^\\n]+))?/",
"format_firstline" => "/^[s]/"
})
])
Expand Down Expand Up @@ -742,8 +757,8 @@ def test_multiline_with_emit_unmatched_lines_true(data)
end

data(
flat: MULTILINE_CONFIG,
parse: PARSE_MULTILINE_CONFIG)
flat: MULTILINE_CONFIG_WITH_NEWLINE,
parse: PARSE_MULTILINE_CONFIG_WITH_NEWLINE)
def test_multiline_with_emit_unmatched_lines2(data)
config = data + config_element("", "", { "emit_unmatched_lines" => true })
File.open("#{TMP_DIR}/tail.txt", "wb") { |f| }
Expand Down

0 comments on commit 50a10cb

Please sign in to comment.