-
-
Save zoffixznet/82efbc2821bb908515125d087b457735 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6.d.PREVIEW; | |
use Test; | |
plan 100_000; | |
for ^100_000 { | |
subtest 'native num defaults to 0e0' => { | |
plan 8; | |
my num $x; | |
is-deeply $x, 0e0, '`my` variable'; | |
is-deeply my class { has num $.z }.new.z, 0e0, 'class attribute'; | |
is-deeply my role { has num $.z }.new.z, 0e0, 'role attribute'; | |
is-deeply my class { submethod z(num $v?) { $v } }.new.z, 0e0, 'submethod param'; | |
is-deeply my class { method z(num $v?) { $v } }.new.z, 0e0, 'method param'; | |
is-deeply sub (num $v?) { $v }(), 0e0, 'sub param'; | |
is-deeply -> num $v? { $v }(), 0e0, 'block param'; | |
my num @a; is-deeply @a[0], 0e0, 'native num array unset element'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment