my
$api
= SPVM::api();
my
$start_memory_blocks_count
=
$api
->get_memory_blocks_count();
{
like(
$SPVM::VERSION
,
qr|[\d\._]+|
);
my
$spvm_version_in_spvm_api_header
= SPVM::Builder::Util::get_spvm_version_string;
is(
$SPVM::VERSION
,
$spvm_version_in_spvm_api_header
);
}
{
for
my
$miner_version
(0 .. 999) {
ok(SPVM::Fn->to_double(
sprintf
(
"1.%03d000"
,
$miner_version
)) == SPVM::Fn->to_double(
sprintf
(
"1.%03d"
,
$miner_version
)));
ok(SPVM::Fn->to_double(
sprintf
(
"1.%03d001"
,
$miner_version
)) > SPVM::Fn->to_double(
sprintf
(
"1.%03d"
,
$miner_version
)));
}
}
$api
->set_exception(
undef
);
my
$end_memory_blocks_count
=
$api
->get_memory_blocks_count();
is(
$end_memory_blocks_count
,
$start_memory_blocks_count
);
done_testing;