Skip to content

Instantly share code, notes, and snippets.

@masterzen
Created November 20, 2009 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterzen/239550 to your computer and use it in GitHub Desktop.
Save masterzen/239550 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
BEGIN {
require 'mysql-agent';
}
use Data::Dumper;
use Test::More tests => 9;
$innodb_parser = InnoDBParser->new;
s(
$innodb_parser->make_bigint('0', '1170663853'),
'1170663853',
'make_bigint 0 1170663853'
);
is(
$innodb_parser->make_bigint('1', '504617703'),
'4799584999',
'make_bigint 1 504617703'
);
is(
$innodb_parser->make_bigint('EF861B144C'),
'1028747105356',
'make_bigint EF861B144C'
);
is(
$innodb_parser->tonum('0'),
'0',
'tonum 0'
);
is(
$innodb_parser->tonum(),
'0',
'tonum undef'
);
is(
$innodb_parser->tonum('74900191315') - $innodb_parser->tonum('1170664159'),
'73729527156',
'substraction 1170664159 74900191315'
);
is(
$innodb_parser->tonum('39731928'),
'39731928',
'should get 39731928'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment