@@ -23,27 +23,28 @@ sub make-string(@a) {
23
23
" deletion of an array element returned the right thing" ;
24
24
is make-string(@ array ), " a b Any() d" , " deletion of an array element" ;
25
25
26
- is ~ @ array . delete (0 , 3 ), " a d" ,
26
+ is ~ @ array . delete (3 ), " d" ,
27
27
" deletion of array elements returned the right things" ;
28
28
# ?pugs todo
29
- is make-string(@ array ), " Any() b" , " deletion of array elements (1)" ;
29
+ is make-string(@ array ), " a b" , " deletion of array elements (1)" ;
30
30
# ?pugs todo
31
31
is + @ array , 2 , " deletion of array elements (2)" ;
32
32
}
33
33
34
34
# W/ negative indices:
35
+ # ?rakudo skip ":delete NYI, but will be shortly"
35
36
{
36
37
my @ array = <a b c d >;
37
38
# ?pugs todo
38
- is ~ @ array . delete ( * -2 ) , " c" ,
39
+ is ~ @ array [ * - 2 ] : delete , " c" ,
39
40
" deletion of array element accessed by an negative index returned the right thing" ;
40
41
# @array is now ("a", "b", Any, "d") ==> double spaces
41
42
# ?pugs todo
42
43
is make-string(@ array ), " a b Any() d" , " deletion of an array element accessed by an negative index (1)" ;
43
44
is + @ array , 4 , " deletion of an array element accessed by an negative index (2)" ;
44
45
45
46
# ?pugs todo
46
- is ~ @ array . delete ( * -1 ) , " d" ,
47
+ is ~ @ array [ * - 1 ] : delete , " d" ,
47
48
" deletion of last array element returned the right thing" ;
48
49
# @array is now ("a", "b")
49
50
# ?pugs todo
@@ -54,9 +55,10 @@ sub make-string(@a) {
54
55
55
56
# W/ multiple positive and negative indices:
56
57
# ?pugs todo
58
+ # ?rakudo skip ":delete NYI, but will be shortly"
57
59
{
58
60
my @ array = <a b c d e f >;
59
- is ~ @ array . delete ( 2 , * -3 , * -1 ) , " c d f" ,
61
+ is ~ @ array [ 2 , * -3 , * -1 ] : delete , " c d f" ,
60
62
" deletion of array elements accessed by positive and negative indices returned right things" ;
61
63
# @array is now ("a", "b", Any, Any, "e") ==> double spaces
62
64
is make-string(@ array ), " a b Any() Any() e" ,
@@ -67,11 +69,11 @@ sub make-string(@a) {
67
69
68
70
# Results taken from Perl 5
69
71
# ?niecza todo "Not sure if this test is correct or not"
70
- # ?rakudo todo "Not sure if this test is correct or not"
71
72
# ?pugs todo "Not sure if this test is correct or not"
73
+ # ?rakudo skip ":delete NYI, but will be shortly"
72
74
{
73
75
my @ array = <a b c >;
74
- is ~ @ array . delete ( 2 , * -1 ) , " c b" ,
76
+ is ~ @ array [ 2 , * -1 ] : delete , " c b" ,
75
77
" deletion of the same array element accessed by different indices returned right things" ;
76
78
is ~ @ array , " a" ,
77
79
" deletion of the same array element accessed by different indices (1)" ;
@@ -90,9 +92,10 @@ sub make-string(@a) {
90
92
}
91
93
92
94
# W/ one range of positive indices
95
+ # ?rakudo skip ":delete NYI, but will be shortly"
93
96
{
94
97
my @ array = <a b c d e f >;
95
- is ~ @ array . delete ( 2 .. 4 ) , " c d e" ,
98
+ is ~ @ array [ 2 .. 4 ] : delete , " c d e" ,
96
99
" deletion of array elements accessed by a range of positives indices returned right things" ;
97
100
# @array is now ("a", "b", Any, Any, Any, "f") ==> 4 spaces
98
101
is make-string(@ array ), " a b Any() Any() Any() f" ,
@@ -101,9 +104,10 @@ sub make-string(@a) {
101
104
" deletion of array elements accessed by a range of positive indices (2)" ;
102
105
}
103
106
107
+ # ?rakudo skip ":delete NYI, but will be shortly"
104
108
{
105
109
my @ array = <a b c d e f >;
106
- is ~ @ array . delete ( 2 ^.. 4 ) , " d e" ,
110
+ is ~ @ array [ 2 ^.. 4 ] : delete , " d e" ,
107
111
" deletion of array elements accessed by a range of positives indices returned right things (2)" ;
108
112
# @array is now ("a", "b", "c", Any, Any, "f") ==> 4 spaces
109
113
is make-string(@ array ), " a b c Any() Any() f" ,
0 commit comments