Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[S03-smartmatch/range-range.t] new test file
- Loading branch information
Carl Masak
committed
Apr 5, 2012
1 parent
2365690
commit e630836
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| use v6; | ||
| use Test; | ||
| plan 14; | ||
|
|
||
| #L<S03/Smart matching/Range Range subset range> | ||
| { | ||
| # .bounds.all ~~ X (mod ^'s) | ||
| # means: | ||
| # check whether both .min and .max are inside of the Range X | ||
| # (though this is only true to a first approximation, as | ||
| # those .min and .max values might be excluded) | ||
|
|
||
| ok (2..3 ~~ 1..4), 'proper inclusion +'; | ||
| ok !(1..4 ~~ 2..3), 'proper inclusion -'; | ||
| ok (2..4 ~~ 1..4), 'inclusive vs inclusive right end'; | ||
| ok (2..^4 ~~ 1..4), 'exclusive vs inclusive right end'; | ||
| ok !(2..4 ~~ 1..^4), 'inclusive vs exclusive right end'; | ||
| ok (2..^4 ~~ 1..^4), 'exclusive vs exclusive right end'; | ||
| ok (2..3 ~~ 2..4), 'inclusive vs inclusive left end'; | ||
| ok (2^..3 ~~ 2..4), 'exclusive vs inclusive left end'; | ||
| ok !(2..3 ~~ 2^..4), 'inclusive vs exclusive left end'; | ||
| ok (2^..3 ~~ 2^..4), 'exclusive vs exclusive left end'; | ||
| ok (2..3 ~~ 2..3), 'inclusive vs inclusive both ends'; | ||
| ok (2^..^3 ~~ 2..3), 'exclusive vs inclusive both ends'; | ||
| ok !(2..3 ~~ 2^..^3), 'inclusive vs exclusive both ends'; | ||
| ok (2^..^3 ~~ 2^..^3), 'exclusive vs exclusive both ends'; | ||
| } | ||
|
|
||
| done; | ||
|
|
||
| # vim: ft=perl6 |