Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate dummy arg on .Rat/.FatRat…
For Rat, FatRat, and Int types
- Loading branch information
1 parent
167f0f8
commit 4c337e8
Showing
3 changed files
with
74 additions
and
8 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
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
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,36 @@ | ||
use lib <t/spec/packages/>; | ||
use Test; | ||
use Test::Util; | ||
|
||
plan 8; | ||
|
||
# XXX TODO: swap v6.d.PREVIEW to v6.d, once the latter is available | ||
constant $v6d = 'v6.d.PREVIEW'; | ||
|
||
################### HELPER ROUTINES ################################### | ||
|
||
sub test-deprecation ( | ||
Str:D $lang, Str:D $code, Str:D $desc = "with `$code`", | ||
Bool :$is-visible | ||
) { | ||
is_run ' | ||
use \qq[$lang]; | ||
%*ENV<RAKUDO_NO_DEPRECATIONS>:delete; | ||
\qq[$code] | ||
', { :out(''), :err($is-visible ?? /deprecated/ !! ''), :0status }, | ||
($is-visible ?? 'shows' !! 'no ') | ||
~ " deprecation message $desc [using $lang]"; | ||
} | ||
sub is-deprecated (|c) { test-deprecation |c, :is-visible } | ||
sub isn't-deprecated (|c) { test-deprecation |c } | ||
sub is-newly-deprecated (|c) { | ||
is-deprecated $v6d, |c; | ||
isn't-deprecated 'v6.c', |c; | ||
} | ||
|
||
###################################################################### | ||
|
||
is-newly-deprecated 「$ = 4.2.Rat: 42」; | ||
is-newly-deprecated 「$ = 4.2.FatRat: 42」; | ||
is-newly-deprecated 「$ = FatRat.new(4,2).Rat: 42」; | ||
is-newly-deprecated 「$ = FatRat.new(4,2).FatRat: 42」; |