use v6;
use Test;
plan 19;
my $a;
is($a.WHAT, Any, 'empty scalar is Any');
my @a;
ok(@a ~~ Array, 'it is an Array type');
ok @a ~~ Positional, 'An Array does Positional';
my %a;
ok(%a ~~ Hash, 'it is an Hash type');
ok %a ~~ Associative, 'A Hash does Associative';
my $b1 = [];
ok($b1 ~~ Array, 'it is a Array type');
my %b2 = ("one", 1); my $b2 = %b2;
ok($b2 ~~ Hash, 'it is a Hash type');
my $s1 = sub {};
isa_ok($s1, Sub, 'it is a Sub type');
my $s2 = {};
ok($s2 ~~ Hash, 'it is a Hash type (bare block)');
my $s2a = { $^a };
isa_ok($s2a, Block, 'it is a Parametric type (bare block with placeholder parameters)');
{
my $s3 = -> {};
isa_ok($s3, Block, 'it is a Block type (pointy block)');
}
my $int = 0;
isa_ok($int, Int, 'it is an Int type');
my $num = '';
ok(+$num ~~ Num, 'it is an Num type');
my $float = 0.5e0;
isa_ok($float, Num, 'it is an Num type');
isa_ok(1 / 4, Rat, 'infix:</> of integers produces a Rat');
my $string = "Hello World";
isa_ok($string, Str, 'it is a Str type');
my $bool = (0 == 0);
isa_ok($bool, Bool, 'it is a Bool type');
my $pair = ("foo" => "bar");
isa_ok($pair, Pair, 'it is a Pair type');
{
my $rule = rx/^hello\sworld$/;
isa_ok($rule, Regex, 'it is a Regex type');
}