Test for astyle versioning

This commit is contained in:
Max Howell 2009-06-15 00:54:58 +01:00
parent 92154225dc
commit b3b78eceeb
2 changed files with 10 additions and 3 deletions

View File

@ -77,9 +77,11 @@ def extract_version basename
/((\d+\.)*\d+)$/.match basename
return $1 if $1
# eg. (erlang) otp_src_R13B
/^.*[-_.](.*)$/.match basename
return $1 if $1
# eg. otp_src_R13B (this is erlang's style)
# eg. astyle_1.23_macosx.tar.gz
basename.scan /_([^_]+)/ do |match|
return match.first if /\d/.match $1
end
end

View File

@ -34,6 +34,11 @@ class BeerTasting <Test::Unit::TestCase
assert_equal 'R13B', r.version
end
def test_astyle_verson_style
r=TestFormula.new "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz"
assert_equal '1.23', r.version
end
def test_dos2unix
r=TestFormula.new "http://www.sfr-fresh.com/linux/misc/dos2unix-3.1.tar.gz"
assert_equal '3.1', r.version