diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_syslog.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_syslog.rb b/test/test_syslog.rb index c66e5f5fb2..2a7476191e 100644 --- a/test/test_syslog.rb +++ b/test/test_syslog.rb @@ -113,7 +113,7 @@ class TestSyslog < Test::Unit::TestCase end def syslog_line_regex(ident, message) - /(?:^| )#{Regexp.quote(ident)}(?:\[([1-9][0-9]*)\])?(?: |[: ].* )#{Regexp.quote(message)}$/ + /(?:^| )#{Regexp.quote(ident)}(?:\[([1-9][0-9]*)\])?(?: | ([1-9][0-9]*) - - ||[: ].* )#{Regexp.quote(message)}$/ end def test_log @@ -168,8 +168,9 @@ class TestSyslog < Test::Unit::TestCase end m = re.match(line) assert_not_nil(m) - assert_not_nil(m[1]) - assert_equal(pid, m[1].to_i) + output_pid = m[1] || m[2] + assert_not_nil(output_pid) + assert_equal(pid, output_pid.to_i) } } end |