Skip to content

Commit 60bfa55

Browse files
committed
add tests for grade school math operators
1 parent 363b7f1 commit 60bfa55

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

S03-operators/misc.t

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Test;
77
Tests for Synopsis 3
88
=end kwid
99

10-
plan 38;
10+
plan 44;
1111

1212
my $str1 = "foo";
1313
my $str2 = "bar";
@@ -132,5 +132,18 @@ is (2 Z 3), @z, 'joining of single items';
132132
throws-like {"cat" gt Str}, Exception;
133133
}
134134

135+
# unicode operators are there
136+
{
137+
is −1, -1, "unary MINUS SIGN";
138+
139+
is 42−1, 42-1, "infix MINUS SIGN";
140+
my \a = 42; my \b = 1;
141+
is a−b, a - b, "infix MINUS SIGN is not considered a hyphen";
142+
is −a−b, -a - b, "prefix MINUS SIGN works with infix";
143+
144+
is 2 × 3, 6, "we have infix MULTIPLICATION SIGN";
145+
146+
is 2 ÷ 3, ⅔, "we have infix DIVISION SIGN";
147+
}
135148

136149
# vim: ft=perl6

0 commit comments

Comments
 (0)