File: 08_statshash_var_freq.t

package info (click to toggle)
libstatistics-lite-perl 3.62-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 116 kB
  • sloc: perl: 288; makefile: 2
file content (19 lines) | stat: -rwxr-xr-x 598 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 7;

BEGIN { use_ok( 'Statistics::Lite', ':all' ); }

# statshash: variance and frequencies

my %stats= statshash(2,4,2,4);
ok($stats{variancep}, "call variancep - hash-based interface");
ok($stats{stddevp},   "call stddevp - hash-based interface");

%stats= frequencies(1,2,3,3);
is($stats{1}, 1, "frequencies matched correctly for 1");
is($stats{2}, 1, "frequencies matched correctly for 2");
is($stats{3}, 2, "frequencies matched correctly for 3");
is($stats{4}, undef, "frequencies matched correctly for 4");