mirror of
https://github.com/boostorg/website.git
synced 2026-01-24 06:22:15 +00:00
It used to just ignore the beta information, but that wasn't quite right. This does means that the library details will still have information about the beta version after a release, which isn't desirable, but it shouldn't be too hard to write something to strip out old beta information.
53 lines
2.0 KiB
PHP
53 lines
2.0 KiB
PHP
<?php
|
|
|
|
require_once(__DIR__.'/../boost_version.php');
|
|
|
|
$develop = BoostVersion::develop();
|
|
$master = BoostVersion::master();
|
|
$boost_1_55_0 = BoostVersion::release(1, 55, 0);
|
|
$boost_1_54_0 = BoostVersion::release(1, 54, 0);
|
|
$boost_1_56_0 = BoostVersion::release(1, 56, 0);
|
|
$boost_1_56_0_b1 = BoostVersion::release(1, 56, 0, 1);
|
|
$boost_1_56_0_b2 = BoostVersion::release(1, 56, 0, 2);
|
|
|
|
assert($develop->compare($master) > 0);
|
|
assert($master->compare($develop) < 0);
|
|
assert($develop->compare($boost_1_55_0) > 0);
|
|
assert($boost_1_55_0->compare($develop) < 0);
|
|
assert($boost_1_55_0->compare($boost_1_54_0) > 0);
|
|
assert($boost_1_54_0->compare($boost_1_55_0) < 0);
|
|
|
|
assert($boost_1_55_0->compare('boost_1_55_0') == 0);
|
|
assert($boost_1_55_0->compare('boost_1_54_0') > 0);
|
|
assert($boost_1_55_0->compare('boost_1_56_0') < 0);
|
|
|
|
assert($develop->dir() == 'develop');
|
|
assert($master->dir() == 'master');
|
|
assert($boost_1_55_0->dir() == 'boost_1_55_0');
|
|
assert((string) $boost_1_55_0 == '1.55.0');
|
|
|
|
assert($boost_1_56_0_b1->compare($boost_1_56_0_b1) == 0);
|
|
assert($boost_1_56_0_b1->compare($boost_1_56_0_b2) < 0);
|
|
assert($boost_1_56_0_b1->compare($boost_1_56_0) < 0);
|
|
|
|
assert($boost_1_56_0_b2->compare($boost_1_56_0_b1) > 0);
|
|
assert($boost_1_56_0_b2->compare($boost_1_56_0_b2) == 0);
|
|
assert($boost_1_56_0_b2->compare($boost_1_56_0) < 0);
|
|
|
|
assert($boost_1_56_0->compare($boost_1_56_0_b1) > 0);
|
|
assert($boost_1_56_0->compare($boost_1_56_0_b2) > 0);
|
|
assert($boost_1_56_0->compare($boost_1_56_0) == 0);
|
|
|
|
assert($boost_1_56_0_b1->compare('boost_1_56_0beta') == 0);
|
|
assert($boost_1_56_0_b1->compare('boost_1_56_0b1') == 0);
|
|
assert($boost_1_56_0_b1->compare('boost_1_56_0_b1') == 0);
|
|
assert($boost_1_56_0_b1->compare('boost_1_56_0_beta1') == 0);
|
|
assert($boost_1_56_0_b1->compare('boost_1_56_0_beta') == 0);
|
|
|
|
assert($boost_1_56_0_b2->compare('boost_1_56_0b2') == 0);
|
|
assert($boost_1_56_0_b2->compare('boost_1_56_0_b2') == 0);
|
|
assert($boost_1_56_0_b2->compare('boost_1_56_0_beta2') == 0);
|
|
|
|
assert($boost_1_55_0->git_ref() == 'boost-1.55.0');
|
|
assert($boost_1_56_0_b1->git_ref() == 'boost-1.56.0-beta1');
|