<commit_before>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  v5     ~~  v1.2+,  '+ scopes to the whole version, not just the last chunk';
ok  v5.2.3 ~~  v5.2.*, '* wildcard (1+)';
ok  v5.2   ~~  v5.2.*, '* wildcard (2+)';
nok v5.2.3 ~~  v5.3.*, '* wildcard (-)';
nok 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;
<commit_msg>Add version.t cmp test, fudged for rakudo.<commit_after>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  v5     ~~  v1.2+,  '+ scopes to the whole version, not just the last chunk';
ok  v5.2.3 ~~  v5.2.*, '* wildcard (1+)';
ok  v5.2   ~~  v5.2.*, '* wildcard (2+)';
nok v5.2.3 ~~  v5.3.*, '* wildcard (-)';
nok 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';
#?rakudo fudge "NYI"
is  v1.2  cmp  v1.10,  Increase, "cmp isn't Stringy-based";

done;

{'fraction_non_alphanumeric': 0.1954636424282855, 'fraction_numerical': 0.07771847898599066, 'mean_word_length': 2.7440699126092385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2811412', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1341, 'n_words': 381}