Skip to content

Commit d7d2a84

Browse files
committed
Undfudge/fix now passing []:delete and []:exists tests
1 parent cc3ddbe commit d7d2a84

File tree

3 files changed

+27
-38
lines changed

3 files changed

+27
-38
lines changed

S03-operators/subscript-adverbs.t

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ plan 108;
8787
":v on an array returned the correct value";
8888

8989
#?niecza todo
90-
lives_ok {@array[0]:v = "a"}, 'can assign to @array[0]:v';
90+
dies_ok {@array[0]:v = "a"}, 'cannot assign to @array[0]:v';
9191
#?niecza todo
92-
is @array[0], "a",
93-
":v on an array returns lvalues (like normal subscripts do as well)";
92+
is @array[0], "A",
93+
":v on an array returns rvalues (unlike normal subscripts)";
9494

9595
#?niecza skip 'Excess arguments to KERNEL Array.postcircumfix:<[ ]>, unused named v'
9696
is +(@array[0,1]:v), 2,
9797
":v on an array returned a tow-elem array";
9898
#?niecza skip 'Excess arguments to KERNEL Array.postcircumfix:<[ ]>, unused named v'
99-
is ~(@array[0,1]:v), "a B",
99+
is ~(@array[0,1]:v), "A B",
100100
":v on an array returned the correct two-elem array";
101101

102102
#?niecza skip 'Excess arguments to KERNEL Array.postcircumfix:<[ ]>, unused named v'
@@ -188,16 +188,15 @@ plan 108;
188188
":v on a hash returned the correct value";
189189

190190
#?niecza todo
191-
lives_ok {%hash<0>:v = "a"}, 'can assign to %hash<0>:v';
191+
dies_ok {%hash<0>:v = "a"}, 'can assign to %hash<0>:v';
192192
#?niecza todo
193-
is %hash<0>, "a",
194-
":v on a hash returns lvalues (like normal subscripts do as well)";
193+
is %hash<0>, "A", ":v on a hash returns rvalues (unlike normal subscripts)";
195194

196195
#?niecza skip 'Excess arguments to KERNEL Hash.postcircumfix:<{ }>, unused named v'
197196
is +(%hash<0 1>:v), 2,
198197
":v on a hash returned a two-elem array";
199198
#?niecza skip 'Excess arguments to KERNEL Hash.postcircumfix:<{ }>, unused named v'
200-
is ~(%hash<0 1>:v), "a B",
199+
is ~(%hash<0 1>:v), "A B",
201200
":v on a hash returned the correct two-elem array";
202201

203202
#?niecza skip 'Excess arguments to KERNEL Hash.postcircumfix:<{ }>, unused named v'

S32-hash/delete-adverb.t

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ sub gen_hash {
312312
#?pugs 3 skip "no adverbials"
313313
#?niecza 3 skip "no adverbials"
314314
is @a[3]:delete, $b, "Test for delete single element";
315-
#?rakudo todo "not being destructively read yet"
316315
is @a[3], $default, "3 should be deleted now";
317316
is +@a, 10, "array still has same length";
318317

@@ -328,7 +327,6 @@ sub gen_hash {
328327
is @a[9]:delete($dont), $c, "Test non-deletion with (\$dont) single elem";
329328
is @a[9], $c, "9 should not have been deleted";
330329
is @a[9]:delete(1), $c, "Test deletion with (1) single elem";
331-
#?rakudo 2 todo "not being destructively read yet"
332330
is @a[9], $default, "9 should be deleted now";
333331
is +@a, 9, "array should be shortened now";
334332
} #14
@@ -340,9 +338,8 @@ sub gen_hash {
340338
#?pugs 3 skip "no adverbials"
341339
#?niecza 3 skip "no adverbials"
342340
is_deeply @a[1,3]:delete, $b, "Test for delete multiple elements";
343-
#?rakudo todo "not being destructively read yet"
344-
is_deeply @a[1,3], (Any xx 2), "1 3 should be deleted now";
345-
is +@a, 10, "1 3 should be deleted now";
341+
is_deeply @a[1,3], (Any,Any), "1 3 should be deleted now";
342+
is +@a, 10, "1 3 should be deleted now";
346343

347344
#?pugs 11 skip "no adverbials"
348345
#?niecza 11 skip "no adverbials"
@@ -356,9 +353,8 @@ sub gen_hash {
356353
is_deeply @a[2,4,9]:delete($dont), $c, "Test non-deletion with (\$dont) N";
357354
is_deeply @a[2,4,9], $c, "2 4 9 should not have been deleted";
358355
is_deeply @a[2,4,9]:delete(1), $c, "Test deletion with (1) N";
359-
#?rakudo 2 todo "not being destructively read yet"
360-
is_deeply @a[2,4,9], (Any xx 3), "2 4 9 should be deleted now";
361-
is +@a, 9, "array should be shortened now";
356+
is_deeply @a[2,4,9], (Any,Any,Any), "2 4 9 should be deleted now";
357+
is +@a, 9, "array should be shortened now";
362358
} #14
363359

364360
{ # whatever
@@ -368,7 +364,6 @@ sub gen_hash {
368364
#?pugs 2 skip "no adverbials"
369365
#?niecza 2 skip "no adverbials"
370366
is_deeply @a[*]:delete, $all, "Test deletion with whatever";
371-
#?rakudo todo "not being destructively read yet"
372367
is +@a, 0, "* should be deleted now";
373368
} #2
374369

@@ -385,7 +380,6 @@ sub gen_hash {
385380

386381
is +@a, 10, "* should not be deleted now";
387382
is_deeply @a[*]:delete(1), $all, "Test deletion with (1) whatever";
388-
#?rakudo todo "not being destructively read yet"
389383
is +@a, 0, "* should be deleted now";
390384
} #10
391385

S32-hash/exists-adverb.t

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,37 +95,34 @@ sub gen_hash {
9595
is @a.elems, 10, "basic sanity";
9696

9797
#?niecza 4 skip "no adverbials"
98-
#?rakudo 2 todo ":exists is ignored"
9998
isa_ok @a[ 3]:exists, Bool, "Bool test for exists single element";
10099
isa_ok @a[10]:exists, Bool, "Bool test for non-exists single element";
101100
ok @a[ 3]:exists, "Test for exists single element";
102101
ok !(@a[10]:exists), "Test for non-exists single element";
103102

104103
#?niecza 10 skip "no adverbials"
105-
ok @a[ 9]:!exists, "Test non-exists with ! single elem 9";
106-
ok !(@a[10]:!exists), "Test non-exists with ! single elem 10";
107-
ok @a[ 9]:exists(0), "Test non-exists with (0) single elem 9";
108-
ok !(@a[10]:exists(0)), "Test non-exists with (0) single elem 10";
109-
ok @a[ 9]:exists(False), "Test non-exists with (False) single elem 9";
110-
ok !(@a[10]:exists(False)), "Test non-exists with (False) single elem 10";
111-
ok @a[ 9]:exists($dont), "Test non-exists with (\$dont) single elem 9";
112-
ok !(@a[10]:exists($dont)), "Test non-exists with (\$dont) single elem 10";
104+
ok !(@a[ 9]:!exists), "Test non-exists with ! single elem 9";
105+
ok @a[10]:!exists, "Test non-exists with ! single elem 10";
106+
ok !(@a[ 9]:exists(0)), "Test non-exists with (0) single elem 9";
107+
ok @a[10]:exists(0), "Test non-exists with (0) single elem 10";
108+
ok !(@a[ 9]:exists(False)), "Test non-exists with (False) single elem 9";
109+
ok @a[10]:exists(False), "Test non-exists with (False) single elem 10";
110+
ok !(@a[ 9]:exists($dont)), "Test non-exists with (\$dont) single elem 9";
111+
ok @a[10]:exists($dont), "Test non-exists with (\$dont) single elem 10";
113112
ok @a[ 9]:exists(1), "Test exists with (1) single elem 9";
114113
ok !(@a[10]:exists(1)), "Test exists with (1) single elem 10";
115114

116-
#?rakudo 6 todo "[]:exists NYI"
117-
is_deeply @a[1,2, 4]:exists, (True, True, True), "Test exists TTT";
118-
is_deeply @a[1,2,10]:exists, (True, True, False), "Test exists TTF";
119-
is_deeply @a[*]:exists, (True xx 26).Parcel, "Test non-exists T*";
115+
is_deeply @a[1,2, 4]:exists, (True, True, True), "Test exists TTT";
116+
is_deeply @a[1,2,10]:exists, (True, True, False), "Test exists TTF";
117+
is_deeply (@a[*]:exists).list, True xx 10, "Test non-exists T*";
120118
#?niezca 3 todo "adverbial pairs only used as True"
121-
is_deeply @a[1,2, 4]:!exists, (False,False,False), "Test non-exists FFF";
122-
is_deeply @a[1,2,10]:!exists, (False,False,True), "Test non-exists FFT";
123-
is_deeply @a[*]:!exists, (False xx 26).Parcel, "Test non-exists F*";
119+
is_deeply @a[1,2, 4]:!exists, (False,False,False), "Test non-exists FFF";
120+
is_deeply @a[1,2,10]:!exists, (False,False,True), "Test non-exists FFT";
121+
is_deeply (@a[*]:!exists).list, False xx 10, "Test non-exists F*";
124122

125-
#?rakudo 6 todo "[]:exists:kv NYI"
126123
#?niezca 6 todo "no combined adverbial pairs"
127124
is_deeply @a[1,2, 4]:exists:kv,
128-
(1,True,2,True,3,True), "Test exists:kv TTT";
125+
(1,True,2,True,4,True), "Test exists:kv TTT";
129126
is_deeply @a[1,2,10]:exists:kv,
130127
(1,True,2,True), "Test exists:kv TT.";
131128
is_deeply @a[1,2,10]:exists:!kv,
@@ -137,10 +134,9 @@ sub gen_hash {
137134
is_deeply @a[1,2,10]:!exists:!kv,
138135
(1,False,2,False,10,True), "Test exists:kv FFT";
139136

140-
#?rakudo 6 todo "[]:exists:p NYI"
141137
#?niezca 6 todo "no combined adverbial pairs"
142138
is_deeply @a[1,2, 4]:exists:p,
143-
(1=>True,2=>True,3=>True), "Test exists:p TTT";
139+
(1=>True,2=>True,4=>True), "Test exists:p TTT";
144140
is_deeply @a[1,2,10]:exists:p,
145141
(1=>True,2=>True), "Test exists:p TT.";
146142
is_deeply @a[1,2,10]:exists:!p,

0 commit comments

Comments
 (0)