| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  | require "testing_env" | 
					
						
							|  |  |  | require "version" | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 20:32:51 -05:00
										 |  |  | class VersionTests < Homebrew::TestCase | 
					
						
							| 
									
										
										
										
											2013-10-25 17:29:36 -05:00
										 |  |  |   def test_accepts_objects_responding_to_to_str | 
					
						
							| 
									
										
										
										
											2016-09-17 15:32:44 +01:00
										 |  |  |     value = stub(to_str: "0.1") | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     assert_equal "0.1", Version.create(value).to_s | 
					
						
							| 
									
										
										
										
											2013-10-25 17:29:36 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_raises_for_non_string_objects | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     assert_raises(TypeError) { Version.create(1.1) } | 
					
						
							|  |  |  |     assert_raises(TypeError) { Version.create(1) } | 
					
						
							|  |  |  |     assert_raises(TypeError) { Version.create(:symbol) } | 
					
						
							| 
									
										
										
										
											2013-10-25 17:29:36 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2016-02-10 15:03:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_detected_from_url? | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     refute Version.create("1.0").detected_from_url? | 
					
						
							| 
									
										
										
										
											2016-02-10 15:03:40 +01:00
										 |  |  |     assert Version::FromURL.new("1.0").detected_from_url? | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class VersionTokenTests < Homebrew::TestCase | 
					
						
							|  |  |  |   def test_inspect | 
					
						
							|  |  |  |     assert_equal '#<Version::Token "foo">', | 
					
						
							|  |  |  |       Version::Token.new("foo").inspect | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_to_s | 
					
						
							|  |  |  |     assert_equal "foo", Version::Token.new("foo").to_s | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class VersionNullTokenTests < Homebrew::TestCase | 
					
						
							|  |  |  |   def test_inspect | 
					
						
							|  |  |  |     assert_equal "#<Version::NullToken>", Version::NullToken.new.inspect | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_comparing_null | 
					
						
							|  |  |  |     assert_operator Version::NullToken.new, :==, Version::NullToken.new | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-10-25 17:29:36 -05:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 20:32:51 -05:00
										 |  |  | class VersionComparisonTests < Homebrew::TestCase | 
					
						
							| 
									
										
										
										
											2016-01-04 15:17:15 +01:00
										 |  |  |   def test_comparing_regular_versions | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_operator version("0.1"), :==, version("0.1.0") | 
					
						
							|  |  |  |     assert_operator version("0.1"), :<, version("0.2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3"), :>, version("1.2.2") | 
					
						
							|  |  |  |     assert_operator version("1.2.4"), :<, version("1.2.4.1") | 
					
						
							| 
									
										
										
										
											2013-06-05 21:52:48 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-04 15:17:15 +01:00
										 |  |  |     assert_operator version("1.2.3"), :>, version("1.2.3alpha4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3"), :>, version("1.2.3beta2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3"), :>, version("1.2.3rc3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3"), :<, version("1.2.3-p34") | 
					
						
							| 
									
										
										
										
											2013-06-05 21:52:48 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-05 22:04:59 -07:00
										 |  |  |   def test_head | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_operator version("HEAD"), :>, version("1.2.3") | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  |     assert_operator version("HEAD-abcdef"), :>, version("1.2.3") | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_operator version("1.2.3"), :<, version("HEAD") | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  |     assert_operator version("1.2.3"), :<, version("HEAD-fedcba") | 
					
						
							|  |  |  |     assert_operator version("HEAD-abcdef"), :==, version("HEAD-fedcba") | 
					
						
							|  |  |  |     assert_operator version("HEAD"), :==, version("HEAD-fedcba") | 
					
						
							| 
									
										
										
										
											2013-06-05 21:52:48 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-04 15:17:15 +01:00
										 |  |  |   def test_comparing_alpha_versions | 
					
						
							| 
									
										
										
										
											2016-09-24 17:40:37 +01:00
										 |  |  |     assert_operator version("1.2.3alpha"), :<, version("1.2.3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3"), :<, version("1.2.3a") | 
					
						
							| 
									
										
										
										
											2016-01-04 15:17:15 +01:00
										 |  |  |     assert_operator version("1.2.3alpha4"), :==, version("1.2.3a4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :==, version("1.2.3A4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :>, version("1.2.3alpha3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3alpha5") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3alpha10") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3beta2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3rc3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3alpha4"), :<, version("1.2.3-p34") | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_comparing_beta_versions | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :==, version("1.2.3b2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :==, version("1.2.3B2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :>, version("1.2.3beta1") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :<, version("1.2.3beta3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :<, version("1.2.3beta10") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :>, version("1.2.3alpha4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :<, version("1.2.3rc3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :<, version("1.2.3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3beta2"), :<, version("1.2.3-p34") | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_comparing_rc_versions | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :==, version("1.2.3RC3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :>, version("1.2.3rc2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :<, version("1.2.3rc4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :<, version("1.2.3rc10") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :>, version("1.2.3alpha4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :>, version("1.2.3beta2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :<, version("1.2.3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3rc3"), :<, version("1.2.3-p34") | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_comparing_patchlevel_versions | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :==, version("1.2.3-P34") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3-p33") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :<, version("1.2.3-p35") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3-p9") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3alpha4") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3beta2") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3rc3") | 
					
						
							|  |  |  |     assert_operator version("1.2.3-p34"), :>, version("1.2.3") | 
					
						
							| 
									
										
										
										
											2012-07-09 23:00:40 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2012-08-04 00:26:59 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-05 21:52:48 -05:00
										 |  |  |   def test_comparing_unevenly_padded_versions | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_operator version("2.1.0-p194"), :<, version("2.1-p195") | 
					
						
							|  |  |  |     assert_operator version("2.1-p195"), :>, version("2.1.0-p194") | 
					
						
							|  |  |  |     assert_operator version("2.1-p194"), :<, version("2.1.0-p195") | 
					
						
							|  |  |  |     assert_operator version("2.1.0-p195"), :>, version("2.1-p194") | 
					
						
							|  |  |  |     assert_operator version("2-p194"), :<, version("2.1-p195") | 
					
						
							| 
									
										
										
										
											2013-06-05 21:52:48 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_comparison_returns_nil_for_non_version | 
					
						
							| 
									
										
										
										
											2014-07-03 16:32:12 -05:00
										 |  |  |     v = version("1.0") | 
					
						
							|  |  |  |     assert_nil v <=> Object.new | 
					
						
							|  |  |  |     assert_raises(ArgumentError) { v > Object.new } | 
					
						
							| 
									
										
										
										
											2012-08-18 16:07:14 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-06-05 10:06:27 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-24 19:44:27 -05:00
										 |  |  |   def test_erlang_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     versions = %w[R16B R15B03-1 R15B03 R15B02 R15B01 R14B04 R14B03
 | 
					
						
							|  |  |  |                   R14B02 R14B01 R14B R13B04 R13B03 R13B02-1].reverse | 
					
						
							| 
									
										
										
										
											2013-07-24 19:44:27 -05:00
										 |  |  |     assert_equal versions, versions.sort_by { |v| version(v) } | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-12-09 19:43:07 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_hash_equality | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     v1 = version("0.1.0") | 
					
						
							|  |  |  |     v2 = version("0.1.0") | 
					
						
							|  |  |  |     v3 = version("0.1.1") | 
					
						
							| 
									
										
										
										
											2013-12-09 19:43:07 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-03 16:54:46 -05:00
										 |  |  |     assert_eql v1, v2 | 
					
						
							|  |  |  |     refute_eql v1, v3 | 
					
						
							| 
									
										
										
										
											2013-12-09 19:43:07 -06:00
										 |  |  |     assert_equal v1.hash, v2.hash | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     h = { v1 => :foo } | 
					
						
							|  |  |  |     assert_equal :foo, h[v2] | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2012-07-09 23:00:40 -05:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 20:32:51 -05:00
										 |  |  | class VersionParsingTests < Homebrew::TestCase | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  |   def test_pathname_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     d = HOMEBREW_CELLAR/"foo-0.1.9" | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  |     d.mkpath | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_equal version("0.1.9"), d.version | 
					
						
							| 
									
										
										
										
											2014-06-23 21:13:12 -05:00
										 |  |  |   ensure | 
					
						
							|  |  |  |     d.unlink | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  |   def test_no_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_nil "http://example.com/blah.tar" | 
					
						
							|  |  |  |     assert_version_nil "foo" | 
					
						
							| 
									
										
										
										
											2010-02-27 16:03:04 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  |   def test_create | 
					
						
							|  |  |  |     v = Version.create("1.20") | 
					
						
							|  |  |  |     refute_predicate v, :head? | 
					
						
							|  |  |  |     assert_equal "1.20", v.to_str | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_version_all_dots | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.14", "http://example.com/foo.bar.la.1.14.zip" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_version_underscore_separator | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.1", "http://example.com/grc_1.1.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_boost_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.39.0", "http://example.com/boost_1_39_0.tar.bz2" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_erlang_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R13B", "http://erlang.org/download/otp_src_R13B.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-25 10:20:48 -07:00
										 |  |  |   def test_another_erlang_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R15B01", "https://github.com/erlang/otp/tarball/OTP_R15B01" | 
					
						
							| 
									
										
										
										
											2012-08-25 10:20:48 -07:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-15 19:06:03 +00:00
										 |  |  |   def test_yet_another_erlang_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R15B03-1", "https://github.com/erlang/otp/tarball/OTP_R15B03-1" | 
					
						
							| 
									
										
										
										
											2012-12-15 19:06:03 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_p7zip_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "9.04", | 
					
						
							|  |  |  |       "http://kent.dl.sourceforge.net/sourceforge/p7zip/p7zip_9.04_src_all.tar.bz2" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-14 03:46:25 +00:00
										 |  |  |   def test_new_github_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.1.4", "https://github.com/sam-github/libnet/tarball/libnet-1.1.4" | 
					
						
							| 
									
										
										
										
											2012-01-14 03:46:25 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-19 11:11:14 -08:00
										 |  |  |   def test_codeload_style | 
					
						
							|  |  |  |     assert_version_detected "0.7.1", "https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1" | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-23 04:15:47 -04:00
										 |  |  |   def test_elasticsearch_alpha_style | 
					
						
							|  |  |  |     assert_version_detected "5.0.0-alpha5", "https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/5.0.0-alpha5/elasticsearch-5.0.0-alpha5.tar.gz" | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_gloox_beta_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.0-beta7", "http://camaya.net/download/gloox-1.0-beta7.tar.bz2" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-27 08:42:50 +02:00
										 |  |  |   def test_sphinx_beta_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.10-beta", "http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-08-27 08:42:50 +02:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_astyle_verson_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.23", "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_version_dos2unix | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "3.1", "http://www.sfr-fresh.com/linux/misc/dos2unix-3.1.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_version_internal_dash | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.1-2", "http://example.com/foo-arse-1.1-2.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_version_single_digit | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "45", "http://example.com/foo_bar.45.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_noseparator_single_digit | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "45", "http://example.com/foo_bar45.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_version_developer_that_hates_us_format | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.2.3", "http://example.com/foo-bar-la.1.2.3.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_version_regular | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.21", "http://example.com/foo_bar-1.21.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-09 22:41:03 -05:00
										 |  |  |   def test_version_sourceforge_download | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.21", "http://sourceforge.net/foo_bar-1.21.tar.gz/download" | 
					
						
							|  |  |  |     assert_version_detected "1.21", "http://sf.net/foo_bar-1.21.tar.gz/download" | 
					
						
							| 
									
										
										
										
											2011-01-09 22:41:03 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_version_github | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.0.5", "http://github.com/lloyd/yajl/tarball/1.0.5" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-27 15:02:21 -05:00
										 |  |  |   def test_version_github_with_high_patch_number | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.2.34", "http://github.com/lloyd/yajl/tarball/v1.2.34" | 
					
						
							| 
									
										
										
										
											2010-03-27 15:02:21 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_yet_another_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "0.15.1b", "http://example.com/mad-0.15.1b.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_lame_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "398-2", "http://kent.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_ruby_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.9.1-p243", "ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_omega_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "0.80.2", "http://www.alcyone.com/binaries/omega/omega-0.80.2-src.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  |   def test_rc_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.2.2rc1", "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.2rc1.tar.bz2" | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_dash_rc_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.8.0-rc1", "http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   def test_angband_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "3.0.9b", "http://rephial.org/downloads/3.0/angband-3.0.9b-src.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_stable_suffix | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.4.14b", "http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-07-06 11:49:43 -07:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-07-06 13:12:29 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_debian_style_1 | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "3.03", "http://ftp.de.debian.org/debian/pool/main/s/sl/sl_3.03.orig.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-07-06 13:12:29 -07:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_debian_style_2 | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.01b", "http://ftp.de.debian.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz" | 
					
						
							| 
									
										
										
										
											2010-07-06 13:12:29 -07:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2011-06-21 18:40:07 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "4.8.0", "https://homebrew.bintray.com/bottles/qt-4.8.0.lion.bottle.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-03-07 20:44:19 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-17 12:51:31 -05:00
										 |  |  |   def test_versioned_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "4.8.1", "https://homebrew.bintray.com/bottles/qt-4.8.1.lion.bottle.1.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-04-17 12:51:31 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-07 20:44:19 -05:00
										 |  |  |   def test_erlang_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R15B", "https://homebrew.bintray.com/bottles/erlang-R15B.lion.bottle.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-03-07 20:44:19 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-25 10:20:48 -07:00
										 |  |  |   def test_another_erlang_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R15B01", "https://homebrew.bintray.com/bottles/erlang-R15B01.mountain_lion.bottle.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-08-25 10:20:48 -07:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-15 19:06:03 +00:00
										 |  |  |   def test_yet_another_erlang_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "R15B03-1", "https://homebrew.bintray.com/bottles/erlang-R15B03-1.mountainlion.bottle.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-12-15 19:06:03 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-17 12:51:31 -05:00
										 |  |  |   def test_imagemagick_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "6.7.5-7", "http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.5-7.tar.bz2" | 
					
						
							| 
									
										
										
										
											2012-04-17 12:51:31 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-21 17:14:54 -05:00
										 |  |  |   def test_imagemagick_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "6.7.5-7", "https://homebrew.bintray.com/bottles/imagemagick-6.7.5-7.lion.bottle.tar.gz" | 
					
						
							| 
									
										
										
										
											2012-04-17 12:51:31 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_imagemagick_versioned_bottle_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "6.7.5-7", "https://homebrew.bintray.com/bottles/imagemagick-6.7.5-7.lion.bottle.1.tar.gz" | 
					
						
							| 
									
										
										
										
											2011-09-21 17:14:54 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2012-03-11 15:04:03 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_dash_version_dash_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "3.4", "http://www.antlr.org/download/antlr-3.4-complete.jar" | 
					
						
							| 
									
										
										
										
											2012-03-11 15:04:03 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-16 10:31:03 +01:00
										 |  |  |   def test_jenkins_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.486", "http://mirrors.jenkins-ci.org/war/1.486/jenkins.war" | 
					
						
							| 
									
										
										
										
											2016-02-17 12:26:45 +01:00
										 |  |  |     assert_version_detected "0.10.11", "https://github.com/hechoendrupal/DrupalConsole/releases/download/0.10.11/drupal.phar" | 
					
						
							| 
									
										
										
										
											2012-10-16 10:31:03 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-01 17:30:44 +00:00
										 |  |  |   def test_apache_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.2.0-rc2", "http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-01-01 17:30:44 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-27 22:34:53 +00:00
										 |  |  |   def test_jpeg_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "8d", "http://www.ijg.org/files/jpegsrc.v8d.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-01-27 22:34:53 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-20 15:52:08 -05:00
										 |  |  |   def test_version_ghc_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "7.0.4", "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.bz2" | 
					
						
							|  |  |  |     assert_version_detected "7.0.4", "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-i386-apple-darwin.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-09-20 15:52:08 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2012-04-06 00:08:23 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   def test_pypy_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.4.1", "http://pypy.org/download/pypy-1.4.1-osx.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_openssl_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "0.9.8s", "http://www.openssl.org/source/openssl-0.9.8s.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_xaw3d_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.5E", "ftp://ftp.visi.com/users/hawkeyd/X/Xaw3d-1.5E.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_assimp_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.0.863", "http://downloads.sourceforge.net/project/assimp/assimp-2.0/assimp--2.0.863-sdk.zip" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_cmucl_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "20c", "http://common-lisp.net/project/cmucl/downloads/release/20c/cmucl-20c-x86-darwin.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_fann_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.1.0beta", "http://downloads.sourceforge.net/project/fann/fann/2.1.0beta/fann-2.1.0beta.zip" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_grads_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.0.1", "ftp://iges.org/grads/2.0/grads-2.0.1-bin-darwin9.8-intel.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_haxe_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.08", "http://haxe.org/file/haxe-2.08-osx.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_imap_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2007f", "ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_suite3270_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "3.3.12ga7", "http://downloads.sourceforge.net/project/x3270/x3270/3.3.12ga7/suite3270-3.3.12ga7-src.tgz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_wwwoffle_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.9h", "http://www.gedanken.demon.co.uk/download-wwwoffle/wwwoffle-2.9h.tgz" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:01:54 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_synergy_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "1.3.6p2", "http://synergy.googlecode.com/files/synergy-1.3.6p2-MacOSX-Universal.zip" | 
					
						
							| 
									
										
										
										
											2012-03-11 15:04:03 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-04-24 15:02:05 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_fontforge_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "20120731", "http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20120731-b.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:02:05 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_ezlupdate_version | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2011.10", "https://github.com/downloads/ezsystems/ezpublish-legacy/ezpublish_community_project-2011.10-with_ezc.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-04-24 15:02:05 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2013-06-10 14:55:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_aespipe_version_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "2.4c", | 
					
						
							|  |  |  |       "http://loop-aes.sourceforge.net/aespipe/aespipe-v2.4c.tar.bz2" | 
					
						
							| 
									
										
										
										
											2013-06-10 14:55:23 -05:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2015-01-28 09:28:20 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_win_style | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "0.9.17", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.17-w32.zip" | 
					
						
							|  |  |  |     assert_version_detected "1.29", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip" | 
					
						
							| 
									
										
										
										
											2015-01-28 09:28:20 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_with_arch | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |     assert_version_detected "4.0.18-1", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm" | 
					
						
							|  |  |  |     assert_version_detected "5.5.7-5", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/autogen/autogen-5.5.7-5.i386.rpm" | 
					
						
							|  |  |  |     assert_version_detected "2.8", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip" | 
					
						
							|  |  |  |     assert_version_detected "2.8", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x64.zip" | 
					
						
							|  |  |  |     assert_version_detected "4.0.18", | 
					
						
							|  |  |  |       "http://ftpmirror.gnu.org/mtools/mtools_4.0.18_i386.deb" | 
					
						
							| 
									
										
										
										
											2015-01-28 09:28:20 +01:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2015-10-02 22:52:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_opam_version | 
					
						
							|  |  |  |     assert_version_detected "2.18.3", | 
					
						
							|  |  |  |       "https://opam.ocaml.org/archives/lablgtk.2.18.3+opam.tar.gz" | 
					
						
							|  |  |  |     assert_version_detected "1.9", | 
					
						
							|  |  |  |       "https://opam.ocaml.org/archives/sha.1.9+opam.tar.gz" | 
					
						
							|  |  |  |     assert_version_detected "0.99.2", | 
					
						
							|  |  |  |       "https://opam.ocaml.org/archives/ppx_tools.0.99.2+opam.tar.gz" | 
					
						
							|  |  |  |     assert_version_detected "1.0.2", | 
					
						
							|  |  |  |       "https://opam.ocaml.org/archives/easy-format.1.0.2+opam.tar.gz" | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2015-12-26 19:55:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-18 04:53:34 -07:00
										 |  |  |   def test_no_extension_version | 
					
						
							| 
									
										
										
										
											2015-12-26 19:55:19 +01:00
										 |  |  |     assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12" | 
					
						
							| 
									
										
										
										
											2016-08-18 04:53:34 -07:00
										 |  |  |     assert_version_detected "0.7.1", "https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1" | 
					
						
							|  |  |  |     assert_version_detected "0.9.1234", "https://my.datomic.com/downloads/free/0.9.1234" | 
					
						
							|  |  |  |     assert_version_detected "0.9", "https://my.datomic.com/downloads/free/0.9.1t34" | 
					
						
							|  |  |  |     assert_version_detected "1.2.3", "https://my.datomic.com/downloads/free/1.2.3" | 
					
						
							| 
									
										
										
										
											2015-12-26 19:55:19 +01:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2016-01-01 02:29:41 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_dash_separated_version | 
					
						
							|  |  |  |     assert_version_detected "6-20151227", "ftp://gcc.gnu.org/pub/gcc/snapshots/6-20151227/gcc-6-20151227.tar.bz2" | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2016-02-10 15:03:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_from_url | 
					
						
							|  |  |  |     assert_version_detected "1.2.3", | 
					
						
							| 
									
										
										
										
											2016-09-17 15:32:44 +01:00
										 |  |  |       "http://github.com/foo/bar.git", tag: "v1.2.3" | 
					
						
							| 
									
										
										
										
											2016-02-10 15:03:40 +01:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2010-01-29 10:41:03 -08:00
										 |  |  | end | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | class HeadVersionTests < Homebrew::TestCase | 
					
						
							|  |  |  |   def test_create_head | 
					
						
							|  |  |  |     v1 = Version.create("HEAD-abcdef") | 
					
						
							|  |  |  |     v2 = Version.create("HEAD") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert_predicate v1, :head? | 
					
						
							|  |  |  |     assert_predicate v2, :head? | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_commit_assigned | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     v = Version.create("HEAD-abcdef") | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  |     assert_equal "abcdef", v.commit | 
					
						
							|  |  |  |     assert_equal "HEAD-abcdef", v.to_str | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_no_commit | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     v = Version.create("HEAD") | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  |     assert_nil v.commit | 
					
						
							|  |  |  |     assert_equal "HEAD", v.to_str | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def test_update_commit | 
					
						
							| 
									
										
										
										
											2016-07-11 16:09:35 +03:00
										 |  |  |     v1 = Version.create("HEAD-abcdef") | 
					
						
							|  |  |  |     v2 = Version.create("HEAD") | 
					
						
							| 
									
										
										
										
											2016-06-22 10:13:07 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     v1.update_commit("ffffff") | 
					
						
							|  |  |  |     assert_equal "ffffff", v1.commit | 
					
						
							|  |  |  |     assert_equal "HEAD-ffffff", v1.to_str | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     v2.update_commit("ffffff") | 
					
						
							|  |  |  |     assert_equal "ffffff", v2.commit | 
					
						
							|  |  |  |     assert_equal "HEAD-ffffff", v2.to_str | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |