Skip to content

Commit

Permalink
fix false positive UT
Browse files Browse the repository at this point in the history
Signed-off-by: BananaWanted <[email protected]>
  • Loading branch information
BananaWanted authored and BananaWanted committed Feb 4, 2020
1 parent f207424 commit 8f48cc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/plugin/test_parser_syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ def test_parse_with_rfc5424_structured_message
'message_format' => 'rfc5424',
'with_priority' => true,
)
text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi], from Fluentd!'
text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi] from Fluentd!'
@parser.instance.parse(text) do |time, record|
assert_equal(event_time("2017-02-06T13:14:15.003Z", format: '%Y-%m-%dT%H:%M:%S.%L%z'), time)
assert_equal "11111", record["pid"]
assert_equal "ID24224", record["msgid"]
assert_equal "[exampleSDID@20224 iut=\"3\" eventSource=\"Application\" eventID=\"11211\"]",
record["extradata"]
assert_equal "[Hi], from Fluentd!", record["message"]
assert_equal "[Hi] from Fluentd!", record["message"]
end
end

Expand All @@ -328,14 +328,14 @@ def test_parse_with_rfc5424_message_includes_right_bracket
'message_format' => 'rfc5424',
'with_priority' => true,
)
text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi], from Fluentd]!'
text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi] from Fluentd]!'
@parser.instance.parse(text) do |time, record|
assert_equal(event_time("2017-02-06T13:14:15.003Z", format: '%Y-%m-%dT%H:%M:%S.%L%z'), time)
assert_equal "11111", record["pid"]
assert_equal "ID24224", record["msgid"]
assert_equal "[exampleSDID@20224 iut=\"3\" eventSource=\"Application\" eventID=\"11211\"]",
record["extradata"]
assert_equal "[Hi], from Fluentd]!", record["message"]
assert_equal "[Hi] from Fluentd]!", record["message"]
end
end

Expand Down Expand Up @@ -369,7 +369,7 @@ def test_parse_with_rfc5424_message_prefixed_unicode_bom
assert_equal "ID24224", record["msgid"]
assert_equal "[exampleSDID@20224 iut=\"3\" eventSource=\"Application\" eventID=\"11211\"]",
record["extradata"]
assert_equal "[message]\n", record["message"]
assert_equal "[message]", record["message"]
end
end

Expand Down

0 comments on commit 8f48cc5

Please sign in to comment.