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
Add simple tests for gcd.
- Loading branch information
Showing
1 changed file
with
20 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,20 @@ | ||
| use v6; | ||
| use Test; | ||
| plan 5; | ||
|
|
||
| # L<S32::Numeric/Numeric/"=item gcd"> | ||
|
|
||
| =begin pod | ||
| Basic tests for the gcd() builtin | ||
| =end pod | ||
|
|
||
| is 10.gcd(5), 5, "The gcd of 10 and 5 is 5"; | ||
| isa_ok 10.gcd(5), Int, "The gcd of 10 and 5 is an Int"; | ||
| is (-432).gcd(63), 9, "The gcd of -432 and 63 is 9"; | ||
| is gcd(4342, 65536), 2, "The gcd of 4342 and 65536 is 2"; | ||
| isa_ok gcd(4342, 65536), Int, "The gcd of 4342 and 65536 is an Int"; | ||
|
|
||
| done; | ||
| # vim: ft=perl6 |