Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
basic tests for version literals and Version objects
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| use v6; | ||
| use Test; | ||
|
|
||
| is v1.2.3, 'v1.2.3', 'version literal stringification round-trips'; | ||
| is v1.2.3+, 'v1.2.3+', 'version literal stringification with + round-trips'; | ||
| is v1.*.3, 'v1.*.3', 'version literal stringification with * round-trips'; | ||
| ok v1.2.3 eqv v1.2.3, 'eqv works on version literals (+)'; | ||
| nok v5.2.3 eqv v1.2.3, 'eqv works on version literals (-)'; | ||
| nok v1.2+ eqv v1.2, '+ makes a difference in eqv'; | ||
| ok v1.2 === v1.2, 'version literals are value types'; | ||
| nok v1.2 === v1.3, '=== (-)'; | ||
| ok v1.2 ~~ v1.2, 'smart-matching (same)'; | ||
| nok v1.2 ~~ v6.2, 'smart-matching (different)'; | ||
| ok v1.2.0 ~~ v1.2, 'smart-matching treats trailing 0 correctly (left)'; | ||
| ok v1.2 ~~ v1.2.0, 'smart-matching treats trailing 0 correctly (right)'; | ||
| ok v1.2 ~~ v1.0+, 'smart-matching and plus (+1)'; | ||
| ok v1.2 ~~ v1.2+, 'smart-matching and plus (+2)'; | ||
| ok v1.2 ~~ v1.3+, 'smart-matching and plus (-)'; | ||
| ok v1.2.3 ~~ v1, 'smart-matching only cares about the length of the LHS'; | ||
| nok v1.2.3 ~~ v2, '... but it can still fail'; | ||
| is v1.2 cmp v1.2, Same, 'cmp: Same'; | ||
| is v1.2 cmp v3.2, Increase, 'cmp: Increase'; | ||
| is v1.2 cmp v0.2, Decrease, 'cmp: Decrease'; | ||
|
|
||
| done; | ||
|
|