Typesense-Client

 view release on metacpan or  search on metacpan

t/04-version.t  view on Meta::CPAN

# PURPOSE: Verify version parsing and comparison (pure logic, no server)
# LAYER:   unit
# COVERS:  Typesense::Client::Version

use v5.38;
use warnings;
use Test::More;

use Typesense::Client::Version;

sub v ($string) { Typesense::Client::Version->new(version_string => $string) }

subtest 'Typesense is not strictly semver' => sub {
    ## What a real Typesense 28 reports: two components, not three.
    my $v = v('28.0');
    is("$v", '28.0', 'stringifies to what the server said');
    is($v->major, 28, 'major');
    is($v->minor, 0,  'minor');
    is($v->patch, 0,  'the missing component is zero, not an error');

    ## And a release candidate, which is not numeric at all in its tail.



( run in 1.219 second using v1.01-cache-2.11-cpan-ff9377addf4 )