Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: rakudo-master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (21 sloc) 0.715 kb
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
use v6;
use Test;
plan 15;

# L<S03/Loose unary precedence>

ok(so 1, "so 1 is true");
ok(so -1, "so -1 is true");
ok(not so 0, "not so 0 is true");
ok(so sub{}, 'so sub{} is true');
ok(so "x", 'so "x" is true');

my $a = 1; ok(so $a, 'so $true_var is true');
my $b = 0; ok(!(so $b), 'so $false_var is not true');

ok( so(so 42), "so(so 42) is true");
ok(not so(so 0), "so(so 0) is false");

ok(so Bool::True, "'Bool::True' is true");
ok Bool.so === False, 'Bool.so returns false';
ok(so True, "'True' is true");

#?rakudo todo 'check test and rakudo'
is (so($b) + 1), ((so $b) + 1), 'so($b) is (so $b)';

ok (so my $x = 5), 'so + declaration';
is $x, 5, 'assignment after so worked';

# vim: ft=perl6
Something went wrong with that request. Please try again.