Skip to content

Commit 7b9f474

Browse files
committed
Tests for deprecated core features
1 parent 9de409a commit 7b9f474

File tree

1 file changed

+353
-0
lines changed

1 file changed

+353
-0
lines changed

S02-types/deprecations.t

Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
use v6;
2+
3+
use Test;
4+
5+
plan 25;
6+
7+
# currently deprecated core features
8+
9+
my $line;
10+
11+
# Any
12+
#?niecza skip 'is DEPRECATED NYI'
13+
#?pugs skip 'is DEPRECATED NYI'
14+
{
15+
$line = $?LINE; Any.exists("a");
16+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Any.exists("a")';
17+
Saw 1 call to deprecated code during execution.
18+
================================================================================
19+
Method exists (from Any) called at:
20+
$*PROGRAM_NAME, line $line
21+
Please use the :exists adverb instead.
22+
--------------------------------------------------------------------------------
23+
TEXT
24+
25+
$line = $?LINE; Any.delete("a");
26+
Any.delete("a");
27+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation for Any.delete("a")';
28+
Saw 1 call to deprecated code during execution.
29+
================================================================================
30+
Method delete (from Any) called at:
31+
$*PROGRAM_NAME, lines $line,{$line + 1}
32+
Please use the :delete adverb instead.
33+
--------------------------------------------------------------------------------
34+
TEXT
35+
36+
$line = $?LINE; Any.KeySet;
37+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Any.KeySet';
38+
Saw 1 call to deprecated code during execution.
39+
================================================================================
40+
Method KeySet (from Any) called at:
41+
$*PROGRAM_NAME, line $line
42+
Please use 'SetHash' instead.
43+
--------------------------------------------------------------------------------
44+
TEXT
45+
46+
$line = $?LINE; Any.KeyBag;
47+
Any.KeyBag;
48+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation for Any.KeyBag';
49+
Saw 1 call to deprecated code during execution.
50+
================================================================================
51+
Method KeyBag (from Any) called at:
52+
$*PROGRAM_NAME, lines $line,{$line + 1}
53+
Please use 'BagHash' instead.
54+
--------------------------------------------------------------------------------
55+
TEXT
56+
} #4
57+
58+
# Array
59+
#?niecza skip 'is DEPRECATED NYI'
60+
#?pugs skip 'is DEPRECATED NYI'
61+
{
62+
$line = $?LINE; [].delete(1);
63+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Array.delete(1)';
64+
Saw 1 call to deprecated code during execution.
65+
================================================================================
66+
Method delete (from Array) called at:
67+
$*PROGRAM_NAME, line $line
68+
Please use the :delete adverb instead.
69+
--------------------------------------------------------------------------------
70+
TEXT
71+
} #1
72+
73+
# Bag
74+
#?niecza skip 'is DEPRECATED NYI'
75+
#?pugs skip 'is DEPRECATED NYI'
76+
{
77+
$line = $?LINE; try Bag.new.delete("a"); # try because cannot mutate Bag
78+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Bag.new.delete("a")';
79+
Saw 1 call to deprecated code during execution.
80+
================================================================================
81+
Method delete (from Bag) called at:
82+
$*PROGRAM_NAME, line $line
83+
Please use the :delete adverb instead.
84+
--------------------------------------------------------------------------------
85+
TEXT
86+
} #1
87+
88+
# BagHash
89+
#?niecza skip 'is DEPRECATED NYI'
90+
#?pugs skip 'is DEPRECATED NYI'
91+
{
92+
$line = $?LINE; BagHash.new.delete("a");
93+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. BagHash.new.delete("a")';
94+
Saw 1 call to deprecated code during execution.
95+
================================================================================
96+
Method delete (from BagHash) called at:
97+
$*PROGRAM_NAME, line $line
98+
Please use the :delete adverb instead.
99+
--------------------------------------------------------------------------------
100+
TEXT
101+
} #1
102+
103+
# Baggy
104+
#?niecza skip 'is DEPRECATED NYI'
105+
#?pugs skip 'is DEPRECATED NYI'
106+
{
107+
$line = $?LINE; Bag.new.exists("a");
108+
Bag.new.exists("a");
109+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Bag.new.exists("a")';
110+
Saw 1 call to deprecated code during execution.
111+
================================================================================
112+
Method exists (from Baggy) called at:
113+
$*PROGRAM_NAME, lines $line,{$line + 1}
114+
Please use the :exists adverb instead.
115+
--------------------------------------------------------------------------------
116+
TEXT
117+
118+
$line = $?LINE; BagHash.new.exists("a");
119+
BagHash.new.exists("a");
120+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. BagHash.new.exists("a")';
121+
Saw 1 call to deprecated code during execution.
122+
================================================================================
123+
Method exists (from Baggy) called at:
124+
$*PROGRAM_NAME, lines $line,{$line + 1}
125+
Please use the :exists adverb instead.
126+
--------------------------------------------------------------------------------
127+
TEXT
128+
} #2
129+
130+
# Capture
131+
#?niecza skip 'is DEPRECATED NYI'
132+
#?pugs skip 'is DEPRECATED NYI'
133+
{
134+
$line = $?LINE; Capture.new.exists("a");
135+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. Capture.new.exists("a")';
136+
Saw 1 call to deprecated code during execution.
137+
================================================================================
138+
Method exists (from Capture) called at:
139+
$*PROGRAM_NAME, line $line
140+
Please use the :exists adverb instead.
141+
--------------------------------------------------------------------------------
142+
TEXT
143+
} #1
144+
145+
# Cool
146+
#?niecza skip 'is DEPRECATED NYI'
147+
#?pugs skip 'is DEPRECATED NYI'
148+
{
149+
$line = $?LINE; "a".ucfirst;
150+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation "a".ucfirst';
151+
Saw 1 call to deprecated code during execution.
152+
================================================================================
153+
Method ucfirst (from Cool) called at:
154+
$*PROGRAM_NAME, line $line
155+
Please use 'tc' instead.
156+
--------------------------------------------------------------------------------
157+
TEXT
158+
159+
$line = $?LINE; "a".capitalize;
160+
"a".capitalize;
161+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation "a".capitalize';
162+
Saw 1 call to deprecated code during execution.
163+
================================================================================
164+
Method capitalize (from Cool) called at:
165+
$*PROGRAM_NAME, lines $line,{$line + 1}
166+
Please use 'tclc' instead.
167+
--------------------------------------------------------------------------------
168+
TEXT
169+
} #2
170+
171+
# EnumMap
172+
#?niecza skip 'is DEPRECATED NYI'
173+
#?pugs skip 'is DEPRECATED NYI'
174+
{
175+
$line = $?LINE; EnumMap.exists;
176+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation EnumMap.exists';
177+
Saw 1 call to deprecated code during execution.
178+
================================================================================
179+
Method exists (from EnumMap) called at:
180+
$*PROGRAM_NAME, line $line
181+
Please use the :exists adverb instead.
182+
--------------------------------------------------------------------------------
183+
TEXT
184+
185+
$line = $?LINE; EnumMap.new.exists("a");
186+
EnumMap.new.exists("a");
187+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. EnumMap.new.exists("a")';
188+
Saw 1 call to deprecated code during execution.
189+
================================================================================
190+
Method exists (from EnumMap) called at:
191+
$*PROGRAM_NAME, lines $line,{$line + 1}
192+
Please use the :exists adverb instead.
193+
--------------------------------------------------------------------------------
194+
TEXT
195+
} #2
196+
197+
# GLOBAL
198+
#?niecza skip 'is DEPRECATED NYI'
199+
#?pugs skip 'is DEPRECATED NYI'
200+
{
201+
202+
$line = $?LINE; ucfirst("a");
203+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation ucfirst("a")';
204+
Saw 1 call to deprecated code during execution.
205+
================================================================================
206+
Sub ucfirst (from GLOBAL) called at:
207+
$*PROGRAM_NAME, line $line
208+
Please use 'tc' instead.
209+
--------------------------------------------------------------------------------
210+
TEXT
211+
212+
$line = $?LINE; capitalize("a");
213+
capitalize("a");
214+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation capitalize("a")';
215+
Saw 1 call to deprecated code during execution.
216+
================================================================================
217+
Sub capitalize (from GLOBAL) called at:
218+
$*PROGRAM_NAME, lines $line,{$line + 1}
219+
Please use 'tclc' instead.
220+
--------------------------------------------------------------------------------
221+
TEXT
222+
} #4
223+
224+
# Hash
225+
#?niecza skip 'is DEPRECATED NYI'
226+
#?pugs skip 'is DEPRECATED NYI'
227+
{
228+
$line = $?LINE; Hash.delete;
229+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Hash.delete';
230+
Saw 1 call to deprecated code during execution.
231+
================================================================================
232+
Method delete (from Hash) called at:
233+
$*PROGRAM_NAME, line $line
234+
Please use the :delete adverb instead.
235+
--------------------------------------------------------------------------------
236+
TEXT
237+
238+
$line = $?LINE; Hash.new.delete("a");
239+
Hash.new.delete("a");
240+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Hash.new.delete("a")';
241+
Saw 1 call to deprecated code during execution.
242+
================================================================================
243+
Method delete (from Hash) called at:
244+
$*PROGRAM_NAME, lines $line,{$line + 1}
245+
Please use the :delete adverb instead.
246+
--------------------------------------------------------------------------------
247+
TEXT
248+
} #2
249+
250+
# List
251+
#?niecza skip 'is DEPRECATED NYI'
252+
#?pugs skip 'is DEPRECATED NYI'
253+
{
254+
$line = $?LINE; List.new.exists(1);
255+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation List.new.exists(1)';
256+
Saw 1 call to deprecated code during execution.
257+
================================================================================
258+
Method exists (from List) called at:
259+
$*PROGRAM_NAME, line $line
260+
Please use the :exists adverb instead.
261+
--------------------------------------------------------------------------------
262+
TEXT
263+
} #1
264+
265+
# Mix
266+
#?niecza skip 'is DEPRECATED NYI'
267+
#?pugs skip 'is DEPRECATED NYI'
268+
{
269+
$line = $?LINE; try Mix.new.delete("a"); # try because cannot mutate Mix
270+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Mix.new.delete("a")';
271+
Saw 1 call to deprecated code during execution.
272+
================================================================================
273+
Method delete (from Mix) called at:
274+
$*PROGRAM_NAME, line $line
275+
Please use the :delete adverb instead.
276+
--------------------------------------------------------------------------------
277+
TEXT
278+
} #1
279+
280+
# MixHash
281+
#?niecza skip 'is DEPRECATED NYI'
282+
#?pugs skip 'is DEPRECATED NYI'
283+
{
284+
$line = $?LINE; MixHash.new.delete("a");
285+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. MixHash.new.delete("a")';
286+
Saw 1 call to deprecated code during execution.
287+
================================================================================
288+
Method delete (from MixHash) called at:
289+
$*PROGRAM_NAME, line $line
290+
Please use the :delete adverb instead.
291+
--------------------------------------------------------------------------------
292+
TEXT
293+
} #1
294+
295+
# Set
296+
#?niecza skip 'is DEPRECATED NYI'
297+
#?pugs skip 'is DEPRECATED NYI'
298+
{
299+
$line = $?LINE; try Set.new.delete("a"); # try because cannot mutate Set
300+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Set.new.delete("a")';
301+
Saw 1 call to deprecated code during execution.
302+
================================================================================
303+
Method delete (from Set) called at:
304+
$*PROGRAM_NAME, line $line
305+
Please use the :delete adverb instead.
306+
--------------------------------------------------------------------------------
307+
TEXT
308+
} #1
309+
310+
# SetHash
311+
#?niecza skip 'is DEPRECATED NYI'
312+
#?pugs skip 'is DEPRECATED NYI'
313+
{
314+
$line = $?LINE; SetHash.new.delete("a");
315+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. SetHash.new.delete("a")';
316+
Saw 1 call to deprecated code during execution.
317+
================================================================================
318+
Method delete (from SetHash) called at:
319+
$*PROGRAM_NAME, line $line
320+
Please use the :delete adverb instead.
321+
--------------------------------------------------------------------------------
322+
TEXT
323+
} #1
324+
325+
# Setty
326+
#?rakudo skip 'OH NO, IT DIES'
327+
#?niecza skip 'is DEPRECATED NYI'
328+
#?pugs skip 'is DEPRECATED NYI'
329+
{
330+
$line = $?LINE; Set.new.exists("a");
331+
Set.new.exists("a");
332+
is Deprecation.report, qq:to/TEXT/.chop, 'deprecation Set.new.exists("a")';
333+
Saw 1 call to deprecated code during execution.
334+
================================================================================
335+
Method exists (from Setty) called at:
336+
$*PROGRAM_NAME, lines $line,{$line + 1}
337+
Please use the :exists adverb instead.
338+
--------------------------------------------------------------------------------
339+
TEXT
340+
341+
$line = $?LINE; SetHash.new.exists("a");
342+
SetHash.new.exists("a");
343+
is Deprecation.report, qq:to/TEXT/.chop, 'depr. SetHash.new.exists("a")';
344+
Saw 1 call to deprecated code during execution.
345+
================================================================================
346+
Method exists (from Setty) called at:
347+
$*PROGRAM_NAME, lines $line,{$line + 1}
348+
Please use the :exists adverb instead.
349+
--------------------------------------------------------------------------------
350+
TEXT
351+
} #2
352+
353+
# vim:set ft=perl6

0 commit comments

Comments
 (0)