Affix

 view release on metacpan or  search on metacpan

t/001_affix.t  view on Meta::CPAN

use v5.40;
use lib '../lib', 'lib';
use blib;
use Test2::Tools::Affix qw[:all];
use Affix               qw[:all];
#
$|++;
#
subtest import => sub {
    imported_ok qw[affix pin unpin wrap];
    imported_ok qw[libm libc];
    imported_ok qw[sizeof alignof offsetof];
    imported_ok qw[calloc free malloc realloc dump own
        memchr    memcmp     memcpy     memmove     memset
        strdup    strnlen
        ptr_add   ptr_diff
        address
        is_null
    ];
    imported_ok qw[load_library find_symbol ];
    imported_ok qw[typedef cast coerce];
    imported_ok qw[get_last_error_message];
    imported_ok qw[direct_affix direct_wrap];    # Secrets
};
subtest types => sub {
    imported_ok qw[
        Array     Bool    Callback Char   CodeRef Complex   Double Enum   File
        Float     Float32 Float64  Int    Int128  Int16     Int32  Int64  Int8    Long  LongDouble
        LongLong  M256    M256d    M512   M512d   M512i     Packed PerlIO Pointer SChar
        SInt128   SInt16  SInt32   SInt64 SInt8   SSize_t   SV
        Short     Size_t  String   Struct UChar   UInt      UInt128
        UInt16    UInt32  UInt64   UInt8  ULong   ULongLong UShort
        Union     VarArgs Vector   Void   WChar   WString    ];
    subtest abstract => sub {
        is Void,       'void',       'Void';
        is Bool,       'bool',       'Bool';
        is Char,       'char',       'Char';
        is UChar,      'uchar',      'UChar';
        is Short,      'short',      'Short';
        is UShort,     'ushort',     'UShort';
        is Int,        'int',        'Int';
        is UInt,       'uint',       'UInt';
        is Long,       'long',       'Long';
        is ULong,      'ulong',      'ULong';
        is LongLong,   'longlong',   'LongLong';
        is ULongLong,  'ulonglong',  'ULongLong';
        is Float,      'float',      'Float';
        is Double,     'double',     'Double';
        is LongDouble, 'longdouble', 'LongDouble';
        is SChar,      'char',       'SChar';
    };
    subtest explicit => sub {
        is SInt8,   'sint8',   'SInt8';
        is SInt16,  'sint16',  'SInt16';
        is SInt32,  'sint32',  'SInt32';
        is SInt64,  'sint64',  'SInt64';
        is SInt128, 'sint128', 'SInt128';
    };
    subtest SIMD => sub {
        is M256,  'm256',  'M256';
        is M256d, 'm256d', 'M256d';
        is M512,  'm512',  'M512';



( run in 0.694 second using v1.01-cache-2.11-cpan-0d23b851a93 )