Permalink
Browse files

add new test file

This one consistency-checks the classes defined in Val.pm and
Q.pm against the type objects declared in Builtins.pm. They
should match up. (And since c91608a, they do.)
  • Loading branch information...
masak committed Dec 15, 2015
1 parent c91608a commit 7baadd110c3fd844b902f469e1c93bc0426e31fa
Showing with 19 additions and 0 deletions.
  1. +19 −0 t/integration/consistency.t
@@ -0,0 +1,19 @@
use v6;
use Test;
my @classes = flat
qx[perl6 -ne 'say ~$0 if /^class \h+ ("Q::" \S+)/' lib/_007/Q.pm].lines,
qx[perl6 -ne 'say ~$0 if /^class \h+ ("Val::" \S+)/' lib/_007/Val.pm].lines;
my @builtins = qx!perl6 -ne 'say ~$0 if /"=> Val::Type.of(" (<-[)]>+)/' lib/_007/Runtime/Builtins.pm!.lines;
{
my $missing-classes = (@builtins (-) @classes).keys.map({ "- $_" }).join("\n");
is $missing-classes, "", "all built-in types are also classes";
}
{
my $missing-builtins = (@classes (-) @builtins).keys.map({ "- $_" }).join("\n");
is $missing-builtins, "", "all classes are also built-in types";
}
done-testing;

0 comments on commit 7baadd1

Please sign in to comment.