diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-29 16:06:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-29 16:06:54 +0000 |
commit | 716610ae565caed8df725dd26ffbc2000b673fcd (patch) | |
tree | 9af46bd4743c0429f963efa10889a1288775afff /test/ruby | |
parent | db31f2fafb3634364bba91130162bc9c394f8232 (diff) | |
download | ruby-716610ae565caed8df725dd26ffbc2000b673fcd.tar.gz |
get rid of ambiguous parentheses warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/enc/test_case_comprehensive.rb | 8 | ||||
-rw-r--r-- | test/ruby/enc/test_case_options.rb | 12 | ||||
-rw-r--r-- | test/ruby/test_complex.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_complexrational.rb | 16 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 2 |
5 files changed, 20 insertions, 20 deletions
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb index 7176670881..2ee24f86c9 100644 --- a/test/ruby/enc/test_case_comprehensive.rb +++ b/test/ruby/enc/test_case_comprehensive.rb @@ -35,7 +35,7 @@ TestComprehensiveCaseFold.data_files_available? and class TestComprehensiveCase end end - def self.read_data_file (filename) + def self.read_data_file(filename) IO.foreach(expand_filename(filename), encoding: Encoding::ASCII_8BIT) do |line| if $. == 1 if filename == 'UnicodeData' @@ -140,7 +140,7 @@ TestComprehensiveCaseFold.data_files_available? and class TestComprehensiveCase @@tests ||= [] end - def self.generate_unicode_case_mapping_tests (encoding) + def self.generate_unicode_case_mapping_tests(encoding) all_tests.each do |test| attributes = test.attributes.map(&:to_s).join '-' attributes.prepend '_' unless attributes.empty? @@ -158,7 +158,7 @@ TestComprehensiveCaseFold.data_files_available? and class TestComprehensiveCase end end - def self.generate_case_mapping_tests (encoding) + def self.generate_case_mapping_tests(encoding) all_tests # preselect codepoints to speed up testing for small encodings codepoints = @@codepoints.select do |code| @@ -200,7 +200,7 @@ TestComprehensiveCaseFold.data_files_available? and class TestComprehensiveCase end # test for encodings that don't yet (or will never) deal with non-ASCII characters - def self.generate_ascii_only_case_mapping_tests (encoding) + def self.generate_ascii_only_case_mapping_tests(encoding) all_tests # preselect codepoints to speed up testing for small encodings codepoints = @@codepoints.select do |code| diff --git a/test/ruby/enc/test_case_options.rb b/test/ruby/enc/test_case_options.rb index 761c92d51d..e9bf50fcfc 100644 --- a/test/ruby/enc/test_case_options.rb +++ b/test/ruby/enc/test_case_options.rb @@ -3,21 +3,21 @@ require "test/unit" class TestCaseOptions < Test::Unit::TestCase - def assert_raise_functional_operations (arg, *options) + def assert_raise_functional_operations(arg, *options) assert_raise(ArgumentError) { arg.upcase(*options) } assert_raise(ArgumentError) { arg.downcase(*options) } assert_raise(ArgumentError) { arg.capitalize(*options) } assert_raise(ArgumentError) { arg.swapcase(*options) } end - def assert_raise_bang_operations (arg, *options) + def assert_raise_bang_operations(arg, *options) assert_raise(ArgumentError) { arg.upcase!(*options) } assert_raise(ArgumentError) { arg.downcase!(*options) } assert_raise(ArgumentError) { arg.capitalize!(*options) } assert_raise(ArgumentError) { arg.swapcase!(*options) } end - def assert_raise_both_types (*options) + def assert_raise_both_types(*options) assert_raise_functional_operations 'a', *options assert_raise_bang_operations 'a', *options assert_raise_functional_operations :a, *options @@ -35,21 +35,21 @@ class TestCaseOptions < Test::Unit::TestCase assert_raise_both_types :lithuanian, :ascii end - def assert_okay_functional_operations (arg, *options) + def assert_okay_functional_operations(arg, *options) assert_nothing_raised { arg.upcase(*options) } assert_nothing_raised { arg.downcase(*options) } assert_nothing_raised { arg.capitalize(*options) } assert_nothing_raised { arg.swapcase(*options) } end - def assert_okay_bang_operations (arg, *options) + def assert_okay_bang_operations(arg, *options) assert_nothing_raised { arg.upcase!(*options) } assert_nothing_raised { arg.downcase!(*options) } assert_nothing_raised { arg.capitalize!(*options) } assert_nothing_raised { arg.swapcase!(*options) } end - def assert_okay_both_types (*options) + def assert_okay_both_types(*options) assert_okay_functional_operations 'a', *options assert_okay_bang_operations 'a', *options assert_okay_functional_operations :a, *options diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index a510a07dfa..5707047338 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -434,7 +434,7 @@ class Complex_Test < Test::Unit::TestCase end class ObjectX - def + (x) Rational(1) end + def +(x) Rational(1) end alias - + alias * + alias / + diff --git a/test/ruby/test_complexrational.rb b/test/ruby/test_complexrational.rb index 1e7622a351..0360f5ee42 100644 --- a/test/ruby/test_complexrational.rb +++ b/test/ruby/test_complexrational.rb @@ -214,10 +214,10 @@ class SimpleRat < Numeric def numerator() @num end def denominator() @den end - def +@ () self end - def -@ () self.class.new(-@num, @den) end + def +@() self end + def -@() self.class.new(-@num, @den) end - def + (o) + def +(o) case o when SimpleRat, Rational a = @num * o.denominator @@ -233,7 +233,7 @@ class SimpleRat < Numeric end end - def - (o) + def -(o) case o when SimpleRat, Rational a = @num * o.denominator @@ -249,7 +249,7 @@ class SimpleRat < Numeric end end - def * (o) + def *(o) case o when SimpleRat, Rational a = @num * o.numerator @@ -334,7 +334,7 @@ class SimpleRat < Numeric def divmod(o) [div(o), modulo(o)] end def quotrem(o) [quot(o), remainder(o)] end - def ** (o) + def **(o) case o when SimpleRat, Rational Float(self) ** o @@ -357,7 +357,7 @@ class SimpleRat < Numeric end end - def <=> (o) + def <=>(o) case o when SimpleRat, Rational a = @num * o.denominator @@ -373,7 +373,7 @@ class SimpleRat < Numeric end end - def == (o) + def ==(o) begin (self <=> o) == 0 rescue diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index cf870ad3a2..168383a106 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -567,7 +567,7 @@ class Rational_Test < Test::Unit::TestCase end class ObjectX - def + (x) Rational(1) end + def +(x) Rational(1) end alias - + alias * + alias / + |