@@ -33,7 +33,7 @@ plan 57;
33
33
34
34
is ~ $ ref , " a b c" , ' $arrayref = \@array works (1)' ;
35
35
# Explicit referentiation of arrays in assignment
36
- is + $ ref , 3 , ' $arrayref = \@array works (2)' ;
36
+ is + $ ref , 1 , ' $arrayref = \@array works (2)' ;
37
37
}
38
38
39
39
# Implicit referentiation of hashes in assignment
@@ -50,9 +50,8 @@ plan 57;
50
50
my % hash = (a => 1 , b => 2 , c => 3 );
51
51
my $ ref = \% hash ;
52
52
53
- # ?rakudo todo 'backslashes, captures'
54
- is ~ $ ref . values . sort , " 1 2 3" , ' $hashref = \%hash works (1)' ;
55
- is + $ ref . values , 3 , ' $hashref = \%hash works (2)' ;
53
+ is ~ $ ref [0 ]. values . sort , " 1 2 3" , ' $hashref = \%hash works (1)' ;
54
+ is + $ ref [0 ]. values , 3 , ' $hashref = \%hash works (2)' ;
56
55
}
57
56
58
57
# Implicit referentiation of arrays in assignment to an array element
@@ -74,7 +73,7 @@ plan 57;
74
73
75
74
is ~ @ other , " a b c" , ' @other[$idx] = \@array works (1)' ;
76
75
is + @ other , 2 , ' @other[$idx] = \@array works (2)' ;
77
- is + @ other [1 ], 3 , ' @other[$idx] = \@array works (3)' ;
76
+ is + @ other [1 ], 1 , ' @other[$idx] = \@array works (3)' ;
78
77
}
79
78
80
79
# Implicit referentiation of hashes in assignment to an array element
@@ -94,7 +93,7 @@ plan 57;
94
93
@ other [1 ] = \% hash ;
95
94
96
95
is + @ other , 2 , ' @other[$idx] = \%hash works (1)' ;
97
- is + @ other [1 ], 3 , ' @other[$idx] = \%hash works (2)' ;
96
+ is + @ other [1 ], 1 , ' @other[$idx] = \%hash works (2)' ;
98
97
}
99
98
100
99
# Implicit referentiation of arrays in assignment to a hash element
@@ -114,7 +113,7 @@ plan 57;
114
113
% other <a > = \@ array ;
115
114
116
115
is + % other , 1 , ' %other[$key] = \@array works (1)' ;
117
- is + % other <a >, 3 , ' %other[$key] = \@array works (2)' ;
116
+ is + % other <a >, 1 , ' %other[$key] = \@array works (2)' ;
118
117
}
119
118
120
119
# Implicit referentiation of hashes in assignment to a hash element
@@ -134,7 +133,7 @@ plan 57;
134
133
% other <a > = \% hash ;
135
134
136
135
is + % other , 1 , ' %other[$key] = \%hash works (1)' ;
137
- is + % other <a >, 3 , ' %other[$key] = \%hash works (2)' ;
136
+ is + % other <a >, 1 , ' %other[$key] = \%hash works (2)' ;
138
137
}
139
138
140
139
# Implicit referentiation of arrays in pair creation with key => ...
@@ -152,7 +151,7 @@ plan 57;
152
151
my $ pair = (key => \@ array );
153
152
154
153
is ~ $ pair . value , " a b c" , ' (key => \@array) works (1)' ;
155
- is + $ pair . value , 3 , ' (key => \@array) works (2)' ;
154
+ is + $ pair . value , 1 , ' (key => \@array) works (2)' ;
156
155
}
157
156
158
157
# Implicit referentiation of hashes in pair creation with key => ...
@@ -169,9 +168,8 @@ plan 57;
169
168
my % hash = (a => 1 , b => 2 , c => 3 );
170
169
my $ pair = (key => \% hash );
171
170
172
- # ?rakudo todo 'backslashes, captures'
173
- is ~ $ pair . value . values . sort , " 1 2 3" , ' (key => \%hash) works (1)' ;
174
- is + $ pair . value . values , 3 , ' (key => \%hash) works (2)' ;
171
+ is ~ $ pair . value . [0 ]. values . sort , " 1 2 3" , ' (key => \%hash) works (1)' ;
172
+ is + $ pair . value . [0 ]. values , 3 , ' (key => \%hash) works (2)' ;
175
173
}
176
174
177
175
# Implicit referentiation of arrays in pair creation with :key(...)
@@ -189,7 +187,7 @@ plan 57;
189
187
my $ pair = (: key(\@ array ));
190
188
191
189
is ~ $ pair . value , " a b c" , ' (:key(\@array)) works (1)' ;
192
- is + $ pair . value , 3 , ' (:key(\@array)) works (2)' ;
190
+ is + $ pair . value , 1 , ' (:key(\@array)) works (2)' ;
193
191
}
194
192
195
193
# Implicit referentiation of hashes in pair creation with :key(...)
@@ -207,8 +205,8 @@ plan 57;
207
205
my $ pair = (: key(\% hash ));
208
206
209
207
# ?rakudo todo 'backslashes, captures'
210
- is ~ $ pair . value . values . sort , " 1 2 3" , ' (:key(\%hash)) works (1)' ;
211
- is + $ pair . value . values , 3 , ' (:key(\%hash)) works (2)' ;
208
+ is ~ $ pair . value . [ 0 ] . values . sort , " 1 2 3" , ' (:key(\%hash)) works (1)' ;
209
+ is + $ pair . value . [ 0 ] . values , 3 , ' (:key(\%hash)) works (2)' ;
212
210
}
213
211
214
212
# Implicit referentiation of array literals in pair creation with key => ...
0 commit comments