Suppress ambiguous argument and grouped expression warnings
This commit is contained in:
parent
593289a018
commit
d994c6cdda
@ -10,7 +10,7 @@ module Homebrew extend self
|
|||||||
if ARGV.json == "v1"
|
if ARGV.json == "v1"
|
||||||
print_json
|
print_json
|
||||||
elsif ARGV.flag? '--github'
|
elsif ARGV.flag? '--github'
|
||||||
exec_browser *ARGV.formulae.map { |f| github_info(f) }
|
exec_browser(*ARGV.formulae.map { |f| github_info(f) })
|
||||||
else
|
else
|
||||||
print_info
|
print_info
|
||||||
end
|
end
|
||||||
|
@ -143,7 +143,7 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
FileUtils.cp ABS__FILE__, abcd
|
FileUtils.cp ABS__FILE__, abcd
|
||||||
installed_paths=HOMEBREW_PREFIX.install abcd
|
installed_paths=HOMEBREW_PREFIX.install abcd
|
||||||
abcd = installed_paths[0]
|
abcd = installed_paths[0]
|
||||||
assert (HOMEBREW_PREFIX+orig_abcd.basename).exist?
|
assert((HOMEBREW_PREFIX+orig_abcd.basename).exist?)
|
||||||
assert abcd.exist?
|
assert abcd.exist?
|
||||||
assert_equal HOMEBREW_PREFIX+'abcd', abcd
|
assert_equal HOMEBREW_PREFIX+'abcd', abcd
|
||||||
|
|
||||||
@ -191,6 +191,6 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
assert f == f
|
assert f == f
|
||||||
assert f == g
|
assert f == g
|
||||||
assert f.eql? f
|
assert f.eql? f
|
||||||
assert (not (f.eql? g))
|
assert !f.eql?(g)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -108,8 +108,8 @@ class FormulaTests < Test::Unit::TestCase
|
|||||||
when :lion then 'baadf00d'*5
|
when :lion then 'baadf00d'*5
|
||||||
when :mountain_lion then '8badf00d'*5
|
when :mountain_lion then '8badf00d'*5
|
||||||
end, f.bottle.checksum.hexdigest
|
end, f.bottle.checksum.hexdigest
|
||||||
assert_match /[0-9a-fA-F]{40}/, f.stable.checksum.hexdigest
|
assert_match(/[0-9a-fA-F]{40}/, f.stable.checksum.hexdigest)
|
||||||
assert_match /[0-9a-fA-F]{64}/, f.devel.checksum.hexdigest
|
assert_match(/[0-9a-fA-F]{64}/, f.devel.checksum.hexdigest)
|
||||||
|
|
||||||
assert_equal 1, f.stable.mirrors.length
|
assert_equal 1, f.stable.mirrors.length
|
||||||
assert f.bottle.mirrors.empty?
|
assert f.bottle.mirrors.empty?
|
||||||
|
@ -71,7 +71,7 @@ class InstallTests < Test::Unit::TestCase
|
|||||||
keg=Keg.new f.prefix
|
keg=Keg.new f.prefix
|
||||||
keg.link
|
keg.link
|
||||||
assert_equal 3, HOMEBREW_PREFIX.children.length
|
assert_equal 3, HOMEBREW_PREFIX.children.length
|
||||||
assert (HOMEBREW_PREFIX+'bin').directory?
|
assert((HOMEBREW_PREFIX+'bin').directory?)
|
||||||
assert_equal 3, (HOMEBREW_PREFIX+'bin').children.length
|
assert_equal 3, (HOMEBREW_PREFIX+'bin').children.length
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -16,7 +16,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert pn.arch == :universal
|
assert pn.arch == :universal
|
||||||
assert_match /Mach-O (64-bit )?dynamically linked shared library/, file(pn)
|
assert_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_i386_dylib
|
def test_i386_dylib
|
||||||
@ -30,7 +30,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert !pn.mach_o_bundle?
|
assert !pn.mach_o_bundle?
|
||||||
assert_match /Mach-O dynamically linked shared library/, file(pn)
|
assert_match(/Mach-O dynamically linked shared library/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_x86_64_dylib
|
def test_x86_64_dylib
|
||||||
@ -44,7 +44,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert !pn.mach_o_bundle?
|
assert !pn.mach_o_bundle?
|
||||||
assert_match /Mach-O 64-bit dynamically linked shared library/, file(pn)
|
assert_match(/Mach-O 64-bit dynamically linked shared library/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_mach_o_executable
|
def test_mach_o_executable
|
||||||
@ -58,7 +58,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert pn.mach_o_executable?
|
assert pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert !pn.mach_o_bundle?
|
assert !pn.mach_o_bundle?
|
||||||
assert_match /Mach-O (64-bit )?executable/, file(pn)
|
assert_match(/Mach-O (64-bit )?executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_fat_bundle
|
def test_fat_bundle
|
||||||
@ -72,7 +72,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert pn.mach_o_bundle?
|
assert pn.mach_o_bundle?
|
||||||
assert_match /Mach-O (64-bit )?bundle/, file(pn)
|
assert_match(/Mach-O (64-bit )?bundle/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_i386_bundle
|
def test_i386_bundle
|
||||||
@ -86,7 +86,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert pn.mach_o_bundle?
|
assert pn.mach_o_bundle?
|
||||||
assert_match /Mach-O bundle/, file(pn)
|
assert_match(/Mach-O bundle/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_x86_64_bundle
|
def test_x86_64_bundle
|
||||||
@ -100,7 +100,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert pn.mach_o_bundle?
|
assert pn.mach_o_bundle?
|
||||||
assert_match /Mach-O 64-bit bundle/, file(pn)
|
assert_match(/Mach-O 64-bit bundle/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_non_mach_o
|
def test_non_mach_o
|
||||||
@ -115,8 +115,8 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert !pn.mach_o_bundle?
|
assert !pn.mach_o_bundle?
|
||||||
assert pn.arch == :dunno
|
assert pn.arch == :dunno
|
||||||
assert_no_match /Mach-O (64-bit )?dynamically linked shared library/, file(pn)
|
assert_no_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
||||||
assert_no_match /Mach-O [^ ]* ?executable/, file(pn)
|
assert_no_match(/Mach-O [^ ]* ?executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_architecture_list_extension
|
def test_architecture_list_extension
|
||||||
@ -125,13 +125,13 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert archs.universal?
|
assert archs.universal?
|
||||||
archs.remove_ppc!
|
archs.remove_ppc!
|
||||||
assert_equal 2, archs.length
|
assert_equal 2, archs.length
|
||||||
assert_match /-arch i386/, archs.as_arch_flags
|
assert_match(/-arch i386/, archs.as_arch_flags)
|
||||||
assert_match /-arch x86_64/, archs.as_arch_flags
|
assert_match(/-arch x86_64/, archs.as_arch_flags)
|
||||||
|
|
||||||
pn = Pathname.new("#{TEST_FOLDER}/mach/fat.dylib")
|
pn = Pathname.new("#{TEST_FOLDER}/mach/fat.dylib")
|
||||||
assert pn.archs.universal?
|
assert pn.archs.universal?
|
||||||
assert_match /-arch i386/, pn.archs.as_arch_flags
|
assert_match(/-arch i386/, pn.archs.as_arch_flags)
|
||||||
assert_match /-arch x86_64/, pn.archs.as_arch_flags
|
assert_match(/-arch x86_64/, pn.archs.as_arch_flags)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert pn.text_executable?
|
assert pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert pn.arch == :dunno
|
||||||
assert_match /text executable/, file(pn)
|
assert_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_shebang_with_options
|
def test_shebang_with_options
|
||||||
@ -169,7 +169,7 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert pn.text_executable?
|
assert pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert pn.arch == :dunno
|
||||||
assert_match /text executable/, file(pn)
|
assert_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_malformed_shebang
|
def test_malformed_shebang
|
||||||
@ -185,6 +185,6 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert pn.arch == :dunno
|
||||||
assert_no_match /text executable/, file(pn)
|
assert_no_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -15,21 +15,20 @@ class VersionComparisonTests < Test::Unit::TestCase
|
|||||||
include VersionAssertions
|
include VersionAssertions
|
||||||
|
|
||||||
def test_version_comparisons
|
def test_version_comparisons
|
||||||
assert_equal 0, version('0.1') <=> version('0.1.0')
|
assert version('0.1') == version('0.1.0')
|
||||||
assert_equal -1, version('0.1') <=> version('0.2')
|
assert version('0.1') < version('0.2')
|
||||||
assert_equal 1, version('1.2.3') <=> version('1.2.2')
|
assert version('1.2.3') > version('1.2.2')
|
||||||
assert_equal 1, version('1.2.3-p34') <=> version('1.2.3-p33')
|
assert version('1.2.3-p34') > version('1.2.3-p33')
|
||||||
assert_equal -1, version('1.2.4') <=> version('1.2.4.1')
|
assert version('1.2.4') < version('1.2.4.1')
|
||||||
assert_equal 0, version('HEAD') <=> version('HEAD')
|
assert version('HEAD') > version('1.2.3')
|
||||||
assert_equal 1, version('HEAD') <=> version('1.2.3')
|
assert version('1.2.3') < version('HEAD')
|
||||||
assert_equal -1, version('1.2.3') <=> version('HEAD')
|
assert version('3.2.0b4') < version('3.2.0')
|
||||||
assert_equal -1, version('3.2.0b4') <=> version('3.2.0')
|
assert version('1.0beta6') < version('1.0b7')
|
||||||
assert_equal -1, version('1.0beta6') <=> version('1.0b7')
|
assert version('1.0b6') < version('1.0beta7')
|
||||||
assert_equal -1, version('1.0b6') <=> version('1.0beta7')
|
assert version('1.1alpha4') < version('1.1beta2')
|
||||||
assert_equal -1, version('1.1alpha4') <=> version('1.1beta2')
|
assert version('1.1beta2') < version('1.1rc1')
|
||||||
assert_equal -1, version('1.1beta2') <=> version('1.1rc1')
|
assert version('1.0.0beta7') < version('1.0.0')
|
||||||
assert_equal -1, version('1.0.0beta7') <=> version('1.0.0')
|
assert version('3.2.1') > version('3.2beta4')
|
||||||
assert_equal 1, version('3.2.1') <=> version('3.2beta4')
|
|
||||||
assert_nil version('1.0') <=> 'foo'
|
assert_nil version('1.0') <=> 'foo'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user