### ----------------------------------------------------
### -- Archive::Libarchive
### -- Licenses: Artistic-2.0
### -- Authors: Fernando Santagata
### -- File: t/01-version.rakutest
### ----------------------------------------------------
#!/usr/bin/env raku

use lib 'lib';
use Archive::Libarchive;
use Test;
plan 8;

constant AUTHOR = ?%*ENV<TEST_AUTHOR>;

if AUTHOR {
  my Archive::Libarchive $a .= new(operation => LibarchiveRead);
  my %vers = $a.lib-version;
  is %vers<ver>,     '3007004', 'libarchive version';
  is %vers<strver>,  'libarchive 3.7.4', 'libarchive version as string';
  is %vers<details>,
    'libarchive 3.7.4 zlib/1.3.1 liblzma/5.8.1 bz2lib/1.0.8 liblz4/1.10.0 libzstd/1.5.7',
    'libarchive version details';
  is %vers<liblzma>, '5.8.1', 'liblzma version';
  is %vers<liblz4>,  '1.10.0', 'liblz4 version';
  is %vers<bzlib>,   '1.0.8, 13-Jul-2019', 'bzlib version';
  is %vers<zlib>,    '1.3.1', 'zlib version';
  is %vers<libzstd>, '1.5.7', 'libzstd version';
}else{
  skip-rest 'Skipping author test';
  exit;
}


