diff --git a/t/01-test_adapter.t b/t/01-test_adapter.t new file mode 100755 index 0000000..eda54c0 --- /dev/null +++ b/t/01-test_adapter.t @@ -0,0 +1,25 @@ +#!/usr/bin/perl +use warnings; +use strict; + +{ package Foo; + use Measure::Everything qw( $stats ); + + sub frobnicate { + $stats->write(Foo => @_); + } +} + +use Test::More tests => 3; + +use Measure::Everything::Adapter; +my $m = Measure::Everything::Adapter->set('Test'); + +is_deeply $m->get_stats, [], 'initialized'; + +Foo::frobnicate(42); +Foo::frobnicate(13); +is_deeply $m->get_stats, [['Foo', 42], ['Foo', 13]], 'store'; + +$m->reset; +is_deeply $m->get_stats, [], 'reset';