Alien-XGBoost

 view release on metacpan or  search on metacpan

t/10-dynamic_lib_xgboost.t  view on Meta::CPAN

#!/usr/bin/env perl -w

use strict;
use warnings;
use utf8;

use Test2::V0;
use Test::Alien;
use Alien::XGBoost;

alien_ok 'Alien::XGBoost';

# XGBoost C API lacks XGBVersion o similar
ffi_ok { symbols => [qw(XGBGetLastError XGDMatrixCreateFromMat)] }, with_subtest {
    my ($ffi) = @_;
    my $create_from_matrix =
      $ffi->function( XGDMatrixCreateFromMat => [qw(float[] uint64 uint64 float opaque*)] => 'int' );
    my $matrix = 0;
    my $return_code = $create_from_matrix->call( [ 1, 1 ], 1, 2, "NaN", \$matrix );
    like 0, $return_code;
};

done_testing;



( run in 1.218 second using v1.01-cache-2.11-cpan-e93a5daba3e )