Skip to content

Commit f8d8bff

Browse files
committed
Follow revert to Setty semantics of (<)
As done in rakudo/rakudo@d4436e18ce
1 parent 3bab9ac commit f8d8bff

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

S03-operators/set_proper_subset.t

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ my @pss =
2828
<c b c>.Bag, $b,
2929
<B C C>.BagHash, $bh,
3030
(about => e).Mix, $m,
31-
(minus => -e).Mix, $m,
3231
(dosage => tau).MixHash, $mh,
33-
(minus => -1).MixHash, $mh,
3432
"factual", $map,
3533
"global", $hash,
3634
"ideas", $objh,
@@ -44,10 +42,8 @@ my @pss =
4442
<a b>.Bag, <a a b b c>.Mix, # .Bag -> .Mix
4543
<a b>.Mix, <a a b b c>.Bag, # .Bag -> .Mix
4644

47-
# negatives in Mix less than non-existing
48-
(a => -1).Mix, bag(),
49-
(a => -1).Mix, mix(),
50-
(a => -2).Mix, (a => -1).Mix,
45+
# negatives in Mix
46+
mix(), (a => -1).Mix, # weight not important
5147

5248
# empties always proper subset of not-empties
5349
set(), <a>.Set,
@@ -98,16 +94,17 @@ my @notpss =
9894
$list,
9995
List.new,
10096

101-
(a => -1).Mix => set(), # set forces set semantics
102-
(a => 1).Mix => bag(), # positives in Mix with bag not proper subset
103-
(a => 1).Mix => mix(), # positives in Mix with mix not proper subset
104-
(a => -1).Mix => (a => -2).Mix, # right hand more negative
97+
(a => 1).Mix => set(), # a not on right
98+
(a => -1).Mix => set(), # a not on right
99+
(a => 1).Mix => bag(), # a not on right
100+
(a => -1).Mix => bag(), # a not on right
101+
(a => 1).Mix => mix(), # a not on right
102+
(a => -1).Mix => mix(), # a not on right
105103

106104
# non-empties never subset of empties
107105
<a>.Set => set(),
108106
<a>.Bag => bag(),
109107
<a>.Mix => mix(),
110-
mix() => (a => -1).Mix, # not a proper subset because of negative weight
111108

112109
# various Map coercions that shouldn't be ok
113110
{}, {},
@@ -132,23 +129,29 @@ for
132129
&infix:<<R(>)>>, "R(>)", &infix:<<R(<)>>, "R(<)"
133130
-> &op, $name, &rop, $rname {
134131
for @pss -> $left, $right {
132+
#exit dd $left, $name, $right, True unless
135133
is-deeply op($left,$right), True,
136134
"$left is $name of $right.^name()";
135+
#exit dd $right, $rname, $left, True unless
137136
is-deeply rop($right,$left), True,
138137
"$right.^name() $rname $left";
139138
}
140139
for @notpss {
141140
if $_ ~~ Pair {
141+
#exit dd .key, $name, .value, False unless
142142
is-deeply op(.key,.value), False,
143143
"$_.value() is NOT $name of $_.key.^name()";
144+
#exit dd .value, $rname, .key, False unless
144145
is-deeply rop(.value,.key), False,
145146
"$_.key.^name() NOT $rname $_.value()";
146147
}
147148

148149
# assume $marmoset
149150
else {
151+
#exit dd $marmoset, $name, $_, False unless
150152
is-deeply op($marmoset,$_), False,
151153
"marmoset is NOT $name of $_.^name()";
154+
#exit dd $_, $name, $marmoset, False unless
152155
is-deeply rop($_,$marmoset), False,
153156
"$_.^name() NOT $rname marmoset";
154157
}
@@ -165,23 +168,29 @@ for
165168
&infix:<R⊅>, "R⊅", &infix:<R⊄>, "R⊈"
166169
-> &op, $name, &rop, $rname {
167170
for @pss -> $left, $right {
171+
#exit dd $left, $name, $right, False unless
168172
is-deeply op($left,$right), False,
169173
"$left is NOT $name of $right.^name()";
174+
#exit dd $right, $rname, $left, False unless
170175
is-deeply rop($right,$left), False,
171176
"$right.^name() NOT $rname $left";
172177
}
173178
for @notpss {
174179
if $_ ~~ Pair {
180+
#exit dd .key, $name, .value, True unless
175181
is-deeply op(.key,.value), True,
176182
"$_.value() is NOT $name of $_.key.^name()";
183+
#exit dd .value, $rname, .key, True unless
177184
is-deeply rop(.value,.key), True,
178185
"$_.key.^name() NOT $rname $_.value()";
179186
}
180187

181188
# assume $marmoset
182189
else {
190+
#exit dd $marmoset, $name, $_, True unless
183191
is-deeply op($marmoset,$_), True,
184192
"marmoset is NOT $name of $_.^name()";
193+
#exit dd $_, $name, $marmoset, True unless
185194
is-deeply rop($_,$marmoset), True,
186195
"$_.^name() NOT $rname marmoset";
187196
}

0 commit comments

Comments
 (0)