4 use aliased 'System::Introspector::Report::Source';
6 my $source = Source->new(root => "$FindBin::Bin/data/json/");
7 my @reports = $source->generate(['Perls', {}]);
9 is scalar(@reports), 1, 'single report generated';
10 my $rep = $reports[0];
12 is $rep->{id}, 'perls', 'report id';
13 like $rep->{title}, qr{perl}i, 'report title contains perl';
14 is_deeply $rep->{meta}, {}, 'no metadata in this report';
15 is_deeply $rep->{rowid}, [qw( remote location )], 'correct rowid';
16 my %cols = map { ($_->{key}, 1) } @{$rep->{columns}};
17 ok $cols{$_}, "$_ column exists"
18 for qw( remote hostname location version );
20 { hostname => 'a.example.com',
22 location => '/foo/bar/perl',
25 { hostname => 'a.example.com',
27 location => '/foo/baz/perl',
30 { hostname => 'b.example.com',
32 location => '/foo/bar/perl',
35 { hostname => 'b.example.com',
37 location => '/foo/qux/perl',
41 for my $idx (0 .. $#rows) {
42 is $rep->{rows}[$idx]{$_}, $rows[$idx]{$_}, "row $idx $_ value"
43 for sort keys %{$rows[$idx]};