Kouhei Sutou 2019-05-12 09:45:25 +0900 (Sun, 12 May 2019) Revision: 885f8b97a92cacfa802b0704ca1e15374c391bc8 https://github.com/groonga/grntest/commit/885f8b97a92cacfa802b0704ca1e15374c391bc8 Message: test: update Removed files: test/test-log-parser.rb Modified files: test/executors/test-base-executor.rb Modified: test/executors/test-base-executor.rb (+9 -9) =================================================================== --- test/executors/test-base-executor.rb 2019-05-12 09:40:34 +0900 (7afe297) +++ test/executors/test-base-executor.rb 2019-05-12 09:45:25 +0900 (349281d) @@ -22,21 +22,21 @@ class TestBaseExecutor < Test::Unit::TestCase end class TestErrorLogLevel < self - data("emergency" => "E", - "alert" => "A", - "critical" => "C", - "error" => "e", - "warning" => "w") + data("emergency" => :emergency, + "alert" => :alert, + "critical" => :critical, + "error" => :error, + "warning" => :warning) def test_important_log_level(level) assert do @executor.send(:important_log_level?, level) end end - data("notice" => "n", - "info" => "i", - "debug" => "d", - "dump" => "-") + data("notice" => :notice, + "info" => :information, + "debug" => :debug, + "dump" => :dump) def test_not_important_log_level(level) assert do not****@execu*****(:important_log_level?, level) Deleted: test/test-log-parser.rb (+0 -77) 100644 =================================================================== --- test/test-log-parser.rb 2019-05-12 09:40:34 +0900 (181e0a6) +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2014 Kouhei Sutou <kou****@clear*****> -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -require "grntest/log-parser" - -class TestLogParser < Test::Unit::TestCase - def parse(log) - parser = Grntest::LogParser.new - entries = [] - parser.parse(log) do |entry| - entries << entry.to_h - end - entries - end - - sub_test_case("#parse") do - def test_one_line - log = "2014-09-27 17:31:53.046467|n| message" - assert_equal([ - { - :timestamp => "2014-09-27 17:31:53.046467", - :log_level => "n", - :message => "message", - }, - ], - parse(log)) - end - - def test_one_lines - log = <<-LOG -2014-09-27 17:31:53.046467|n| notification message -2014-09-27 17:31:54.046467|W| warning message - LOG - assert_equal([ - { - :timestamp => "2014-09-27 17:31:53.046467", - :log_level => "n", - :message => "notification message", - }, - { - :timestamp => "2014-09-27 17:31:54.046467", - :log_level => "W", - :message => "warning message", - }, - ], - parse(log)) - end - - - def test_multi_line - log = <<-LOG -2014-09-27 17:31:53.046467|n| multi -line message - LOG - assert_equal([ - { - :timestamp => "2014-09-27 17:31:53.046467", - :log_level => "n", - :message => "multi\nline message", - }, - ], - parse(log)) - end - end -end -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190512/8a7109a5/attachment-0001.html>