From 1ed847332e09000f677ed61428fde8f098f48a06 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 3 Feb 2015 07:58:01 +0100 Subject: [PATCH] =?UTF-8?q?simple=5Ftest.rb:=20use=20%r{=E2=80=A6}=20regex?= =?UTF-8?q?=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test.d/simple_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test.d/simple_test.rb b/tests/test.d/simple_test.rb index 16abe3d21..dc4b5f556 100644 --- a/tests/test.d/simple_test.rb +++ b/tests/test.d/simple_test.rb @@ -9,7 +9,7 @@ class SimpleTest file_name = class_name_to_file_name class_name content = IO.readlines(file_name).join("") - if ! /class\s+.*?\s+<\s+Test/.match(content) + if ! %r{class\s+.*?\s+<\s+Test}.match(content) content = %Q! class ::#{class_name} < SimpleTest def initialize @@ -90,7 +90,7 @@ class SimpleTest def unlink_tmp_files return if ENV["KEEP_TMPFILES"] == "1" - re = /^#{self.tmp_name_prefix}/ + re = %r{^#{self.tmp_name_prefix}} Dir.entries("/tmp").each do |entry| file = "/tmp/#{entry}" File.unlink(file) if re.match(file) and File.exists?(file) @@ -155,7 +155,7 @@ class SimpleTest :name => full_command_line, :block => lambda { sys "../src/mkvmerge --identify-verbose #{full_command_line} > #{tmp}", :exit_code => 3 - /unsupported container/.match(IO.readlines(tmp).first || '') ? :ok : :bad + %r{unsupported container}.match(IO.readlines(tmp).first || '') ? :ok : :bad }, } end @@ -232,7 +232,7 @@ class SimpleTest fail ArgumentError if args.empty? output = options[:output] || self.tmp - output = "> #{output}" unless /^[>\|]/.match(output) + output = "> #{output}" unless %r{^[>\|]}.match(output) output = '' if options[:output] == :return command = "../src/mkvinfo --engage no_variable_data --ui-language en_US #{args.first} #{output}" self.sys command, :exit_code => options[:exit_code] @@ -264,7 +264,7 @@ class SimpleTest command = args.shift @commands << command - if !/>/.match command + if !%r{>}.match command temp_file = Tempfile.new('mkvtoolnix-test-output') temp_file.close command << " >#{temp_file.path} 2>&1 "