aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_versions.rb
AgeCommit message (Collapse)Author
2013-10-25Disallow initializing Versions with non-stringsJack Nagel
Closes #23553.
2013-09-20At some point this started working againJack Nagel
2013-08-03versions: remove perforce bottle detection.Mike McQuaid
2013-07-24Adjust logic to properly sort erlang versionsJack Nagel
Fixes #21417.
2013-06-30Fixed several broken sourceforge.net download locationsVictor Martinez
Closes #20645. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-06-20perforce: add version detection regex.Mike McQuaid
2013-06-10Add failing test for a misdetected versionJack Nagel
2013-06-05Improve tokenization of version stringsJack Nagel
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-05Add failing test for patchlevel version comparisonsJack Nagel
2013-04-24Add a couple more version testsJack Nagel
2013-04-24Split up big version detection testJack Nagel
2013-04-13Use assert_operatorJack Nagel
2013-04-13Improved formula attribute validationJack Nagel
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-08Fix specs in TestBallJack Nagel
2013-03-28Suppress ambiguous argument and grouped expression warningsJack Nagel
2013-02-18Remove unused variablesJack Nagel
2013-02-07Flesh out MacOSVersion testsJack Nagel
2013-01-30jpeg: support version format.Mike McQuaid
2013-01-29Don't use underscores in (new) bottle filenames.Mike McQuaid
Closes #14270
2013-01-29Cleanup old bottle syntax.Mike McQuaid
2013-01-01Add Apache version style test.Mike McQuaid
2012-12-16Add another Erlang version format.Mike McQuaid
2012-10-16Add Jenkins version matching (and test).Mike McQuaid
2012-08-25erlang: fix version detection and bottles.Mike McQuaid
2012-08-23Version: make MacOSVersion comparison more robustJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Test version interrogation methodsJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Simplify version comparison testsJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Version: build-in devel version comparisonsJack Nagel
The heuristic used by the default version comparison is simple. A version string is scanned for strings of digits, split into an array of these strings, and then an element-wise comparison is done. This fails when presented with something like Version.new("1.0.0beta7") <=> Version.new("1.0.0") because the first three digits match, and the fourth digit of the receiver (7) is greater than the assumed fourth digit of the parameter (0). Fix this by defining an element-wise comparator on a new VersionElement class. This allows us to correctly compare "alpha", "beta", and "rc" style version strings, and keeps the logic out of the main version comparison. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Add custom comparator for MacOS.versionJack Nagel
This will allow us to do comparisons like if MacOS.version >= :lion and hopefully deprecate the MacOS.<name>? family of methods, which are counterinitutive.
2012-08-18Replace version strings with Version objectsJack Nagel
2012-08-18Further version test refactoringJack Nagel
2012-08-18Move version detection to Version classJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Initial version comparison implementationJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18Preliminary version test refactoringJack Nagel
2012-08-09Deprecate ancient formula syntaxJack Nagel
Closes #13444. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04tests: clean up whitespaceJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04Prune some requires from test filesJack Nagel
testing_env already requires utils; set up the ARGV and ENV extensions there as well. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-24Change versioned bottle syntax and fix issues.Mike McQuaid
Fixed #11562.
2012-04-24Revert "Change versioned bottle syntax and fix issues."Mike McQuaid
This reverts commit f80908bead8b620ebcc5cdde9de65e70598002b6.
2012-04-24Change versioned bottle syntax and fix issues.Mike McQuaid
Fixed #11562.
2012-04-06Add test for ghc version styleJack Nagel
the ghc formula had an explicit version because we had trouble parsing the version from the 64-bit URL. It is working now, so add a test to ensure it isn't broken in the future. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-11Remove redundant versions and update version testsJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-10Support bottles for non-Lion OSX versions.Mike McQuaid
2012-01-14Fix libinet version detectionMax Howell
2011-09-21Correctly parse ImageMagick bottle versionJack Nagel
Commit 2695821e98 ("Only use the bottle if its version is up-to-date") essentially broke the ImageMagick bottle, because the version parsing logic returns "1" as the bottle version. Fixing this requires only a slight modification to the bottle URL regex; includes a test. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-06-21Fix brew bottle versioning.Mike McQuaid
2011-03-25Adding version detection to sf.net /download urlsAustin Ziegler
SourceForge links can end with /download which appears to be part of what is used to drive mirror selection. Modifying the version detection extension of pathname.rb to detect this case for both sourceforge.net and sf.net download selections. This is sufficient for version detection but may not be sufficient for other uses of /download links. I have not found any problems with links that use /download, though. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-08-27Fixed recognition of versions like 'foobar-4.50-beta' in Pathname#versionlukas
Sphinx currently has a download name 'http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz', which homebrew currently can't correctly identify - with a small change to the regex for 'foobar-4.5.0-beta1' (make that trailing number optional) - it works like a charm. Signed-off-by: David Höppner <0xffea@gmail.com>
2010-07-06Add debian style names to version checker.Adam Vandenberg
2010-07-06Update version testsAdam Vandenberg