Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add another test for constants and circumfix.
  • Loading branch information
peschwa committed Oct 8, 2015
1 parent 78bb330 commit f1424a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions S06-operator-overloading/sub.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 88;
plan 90;

=begin pod
Expand Down Expand Up @@ -506,13 +506,17 @@ Testing operator overloading subroutines
lives-ok { constant $x = "µ, @"; sub circumfix:<<$x>>($) { 42 } },
'can define circumfix using << >> and both delimiters from the same constant';
my $test = EVAL 'constant $x = "µ, @"; sub circumfix:<<$x>>($) { 42 }; µ 5 @';
is $test, 42, 'can define and use circumfix using << >> and both delimiters from the same constant';
is $test, 42, 'can define and use circumfix using << >> and both delimiters from the same constant (1)';
lives-ok { constant $x = "µµ, @@"; sub circumfix:<<$x>>($) { 42 } },
'can define circumfix using << >> and both delimiters from the same constant';
my $test = EVAL 'constant $x = "µµ, @@"; sub circumfix:<<$x>>($) { 42 }; µµ 5 @@';
is $test, 42, 'can define and use circumfix using << >> and both delimiters from the same constant (2)';
lives-ok { constant sym = "µ, @"; sub circumfix:<< {sym} >>($) { 42 } },
'can define circumfix using << {sym} >> and both delimiters from the same constant';
$test = EVAL 'constant sym = "µ, @"; sub circumfix:<< {sym} >>($) { 42 }; µ 5 @';
is $test, 42, 'can define and use circumfix using << >> and both delimiters from the same constant'
}
# vim: ft=perl6

0 comments on commit f1424a5

Please sign in to comment.