80 Commits

Author SHA1 Message Date
Mike McQuaid
5b4b7b24e6 version: don't let a/b imply alpha/beta.
This is assumption is broken for at least OpenSSL which makes it a
bad general rule.

As discussed in #1102.
2016-09-24 17:40:37 +01:00
Zhiming Wang
19dcb2cf41
test_versions: add elasticsearch alpha test case 2016-09-23 06:23:37 -04:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
ilovezfs
a5a1b2969f version: fix parsing of URLs ending with version
https://github.com/lihaoyi/Ammonite/releases/download/0.7.4/0.7.4

was parsing as "0.7" not "0.7.4" since ".4" was being treated as a
legitimate file extension. At minimum, let's insist that a valid file
extension include at least one letter to avoid lopping off part of the
correct version string.
2016-08-18 06:51:02 -07:00
Andrea Kao
8ec59253df tests: fix code style issues (#587) 2016-08-06 07:04:59 +02:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
Vlad Shablinsky
00cdd5f481
Add HeadVersion tests 2016-07-16 20:39:13 +08:00
Alex Dunn
f15532452e version: correctly parse codeload URLs
Needed for Homebrew/homebrew#49346.

Closes Homebrew/homebrew#49354.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2016-02-19 17:36:42 -08:00
Baptiste Fontaine
4c5aee7a56 version: fix GitHub releases URLs parsing
The current code doesn't work with releases that have more than one
digit in the third group, i.e.:

  .../releases/download/1.2.3/...  works
  .../releases/download/1.2.34/... doesn't work

Closes Homebrew/homebrew#49255.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-17 13:23:26 +01:00
Baptiste Fontaine
0386f33222 tests: Add missing version tests
Closes Homebrew/homebrew#49031.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-10 18:47:00 +01:00
Martin Afanasjew
301d88544f test: exhaustively test comparison of versions
This tests all possible combinations of alpha, beta, RC, regular, and
patch versions. Also improves code coverage and partitions the version
comparison tests into more uniform chunks.

Closes Homebrew/homebrew#47669.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:26:25 +01:00
Xiyue Deng
e1dfafa54c Improve dash separated version detection.
* Also with test case.

Closes Homebrew/homebrew#47584.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-02 20:06:17 +01:00
Stefano Pigozzi
e865cee3d3 Fix version parsing on URLs with no extensions 2015-12-26 21:47:14 +00:00
Baptiste Fontaine
cc7a047edc version: parse opam archives
Closes Homebrew/homebrew#44544.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-04 10:31:46 +02:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
43ce8b0791 Stop testing implementation 2015-05-04 20:43:08 -04:00
Mike McQuaid
17bfb0f804 Remove SourceForge references.
It was fun but we just love Bintray more than you.

Closes Homebrew/homebrew#37211.

Closes Homebrew/homebrew#37213.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-26 11:32:42 +00:00
Baptiste Fontaine
a9c4091de7 Fix more version misdetections for URLs with archs
Closes Homebrew/homebrew#36368.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-30 08:55:49 +00:00
Baptiste Fontaine
a9e8dfb996 Fix version misdetections for URLs with OS/archs
Closes Homebrew/homebrew#36308.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-28 14:19:21 +00:00
Jack Nagel
dfb7657557 Compare patchlevels numerically rather than lexically
Fixes Homebrew/homebrew#32960.
2014-10-06 13:55:23 -05:00
Jack Nagel
7d8a901f7a Add assert_eql to provide better failure messages for eql? tests 2014-07-03 16:55:13 -05:00
Jack Nagel
1ee4cd94ba Fix PkgVersion#<=> 2014-07-03 16:37:43 -05:00
Jack Nagel
9f03b28573 Fix directory leak in test_pathname_version 2014-06-23 22:11:39 -05:00
Jack Nagel
89d74ec475 Move test helpers into Homebrew::TestCase 2014-06-18 20:32:51 -05:00
Jack Nagel
982e9239b8 Use a custom test class so we can avoid monkeypatching 2014-06-18 20:32:51 -05:00
Jack Nagel
0f5a80a97b Fix tokenizing openssl style versions
Fixes Homebrew/homebrew#25736.
2014-01-11 20:00:34 -06:00
Jack Nagel
b6cbd08e93 Implement hash equality for Version 2013-12-09 19:43:07 -06:00
Jack Nagel
383b321119 Disallow initializing Versions with non-strings
Closes Homebrew/homebrew#23553.
2013-10-25 17:29:45 -05:00
Jack Nagel
5b7b8fb5da At some point this started working again 2013-09-20 15:52:08 -05:00
Mike McQuaid
705a248719 versions: remove perforce bottle detection. 2013-08-03 22:27:42 -07:00
Jack Nagel
023aff10c7 Adjust logic to properly sort erlang versions
Fixes Homebrew/homebrew#21417.
2013-07-24 19:48:21 -05:00
Victor Martinez
829675719b Fixed several broken sourceforge.net download locations
Closes Homebrew/homebrew#20645.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-06-30 12:17:57 -07:00
Mike McQuaid
01e5e428eb perforce: add version detection regex. 2013-06-20 13:07:59 +01:00
Jack Nagel
784c9670f1 Add failing test for a misdetected version 2013-06-10 14:55:23 -05:00
Jack Nagel
28acfbba51 Improve tokenization of version strings
Tokens like "b4", "beta1", "p195", &c. are now treated as atoms rather
than being broken down even further. Additionally, we enable support for
padding in the middle of versions strings, so we can successfully
compare something like "2.1-p195" with "2.1.0-p194" by inferring that
"2.1" is really "2.1.0".

This fixes the comparison "9.9.3-P1" > "9.9.3" which previously has not
been handled correctly.
2013-06-05 22:03:58 -05:00
Jack Nagel
1deeb1c7ef Add failing test for patchlevel version comparisons 2013-06-05 10:06:37 -05:00
Jack Nagel
b7066b6e74 Add a couple more version tests 2013-04-24 15:02:05 -05:00
Jack Nagel
be32a3ee88 Split up big version detection test 2013-04-24 15:01:54 -05:00
Jack Nagel
5fc772b8e9 Use assert_operator 2013-04-13 19:50:02 -05:00
Jack Nagel
2e26afe556 Improved formula attribute validation
The initializer for Formula does a number of validations, but it does
them in a weird order, and some attributes aren't validated under
certain circumstances. This became even more of a mess when most
software package attributes were moved into the SoftwareSpec class.

This commit removes the last vestiges of storing these attributes as
instance variables. In particular, it eliminates #set_instance_variable
and #validate_variable, replacing them with methods that operate on
SoftwareSpec instances, and generate more useful errors.

Doing these validations unconditionally in the initializer means we bail
out much earlier if the formula has invalid attributes or is not fully
specified, and no longer need to validate in #prefix.

Technically we don't need to validate in #brew either, but we continue
to do so anyway as a safety measure, and because we cannot enforce calls
to super in subclasses.
2013-04-13 17:40:12 -05:00
Jack Nagel
d07defa7c1 Fix specs in TestBall 2013-04-08 17:43:01 -05:00
Jack Nagel
d994c6cdda Suppress ambiguous argument and grouped expression warnings 2013-03-28 17:37:29 -05:00
Jack Nagel
1a799f04e6 Remove unused variables 2013-02-18 12:13:35 -06:00
Jack Nagel
b41bb64c7a Flesh out MacOSVersion tests 2013-02-07 12:35:15 -06:00
Mike McQuaid
eec8cc6a12 jpeg: support version format. 2013-01-30 21:29:19 -08:00
Mike McQuaid
b58077b3e8 Don't use underscores in (new) bottle filenames.
Closes Homebrew/homebrew#14270
2013-01-29 17:14:09 -08:00
Mike McQuaid
1107171f83 Cleanup old bottle syntax. 2013-01-29 17:14:00 -08:00
Mike McQuaid
df2cdc681a Add Apache version style test. 2013-01-01 17:30:57 +00:00
Mike McQuaid
7d61bfe88f Add another Erlang version format. 2012-12-16 14:35:41 +00:00
Mike McQuaid
425440de3b Add Jenkins version matching (and test). 2012-10-16 10:31:35 +01:00