-
Notifications
You must be signed in to change notification settings - Fork 3
/
01-basic.t
32 lines (27 loc) · 840 Bytes
/
01-basic.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use v6.c;
use Test;
use Scalar::Util;
my @supported =
<blessed dualvar isdual readonly refaddr reftype isvstring looks_like_number>;
my @unsupported =
<weaken isweak unweaken openhandle set_prototype tainted>;
my @all = (|@supported, |@unsupported).map: '&' ~ *;
plan @all * 2 + @unsupported;
for @all {
ok !defined(::($_)), "is $_ NOT imported?";
ok defined(Scalar::Util::{$_}), "is $_ externally accessible?";
}
for @unsupported -> $function {
CATCH {
when X::AdHoc {
ok .message.starts-with("'$function'"), "did calling &$function die?";
.resume;
}
default {
fail "calling &$function died with $_.^name()";
.resume;
}
}
Scalar::Util::{'&' ~ $function}(); # should die, if not: not enough tests
}
# vim: ft=perl6 expandtab sw=4