@@ -173,7 +173,7 @@ public static function dataProviderForArray(): array
173173 [
174174 [true , 1 , '1 ' , 1.0 , '1.0 ' ],
175175 false ,
176- [true , 1.0 ],
176+ [true ],
177177 ],
178178 [
179179 [true , 1 , '1 ' , 1.1 , '1.1 ' ],
@@ -473,7 +473,7 @@ public static function dataProviderForGenerators(): array
473473 [
474474 $ gen ([true , 1 , '1 ' , 1.0 , '1.0 ' ]),
475475 false ,
476- [true , 1.0 ],
476+ [true ],
477477 ],
478478 [
479479 $ gen ([true , 1 , '1 ' , 1.1 , '1.1 ' ]),
@@ -773,7 +773,7 @@ public static function dataProviderForIterators(): array
773773 [
774774 $ iter ([true , 1 , '1 ' , 1.0 , '1.0 ' ]),
775775 false ,
776- [true , 1.0 ],
776+ [true ],
777777 ],
778778 [
779779 $ iter ([true , 1 , '1 ' , 1.1 , '1.1 ' ]),
@@ -1073,7 +1073,7 @@ public static function dataProviderForTraversables(): array
10731073 [
10741074 $ trav ([true , 1 , '1 ' , 1.0 , '1.0 ' ]),
10751075 false ,
1076- [true , 1.0 ],
1076+ [true ],
10771077 ],
10781078 [
10791079 $ trav ([true , 1 , '1 ' , 1.1 , '1.1 ' ]),
@@ -1293,6 +1293,38 @@ public function testScientificNotationCoerciveArray(): void
12931293 $ this ->assertSame ('1e2 ' , $ result [0 ]);
12941294 }
12951295
1296+ /**
1297+ * @test distinct coercive collapses numeric forms loose-equal to 1
1298+ */
1299+ public function testOneBoundaryCoerciveArray (): void
1300+ {
1301+ // When
1302+ $ result = [];
1303+ foreach (Set::distinct ([1 , '1.0 ' , '1e0 ' , '01 ' , true ], false ) as $ datum ) {
1304+ $ result [] = $ datum ;
1305+ }
1306+
1307+ // Then
1308+ $ this ->assertCount (1 , $ result );
1309+ $ this ->assertSame (1 , $ result [0 ]);
1310+ }
1311+
1312+ /**
1313+ * @test distinct coercive collapses numeric forms loose-equal to 0
1314+ */
1315+ public function testZeroBoundaryCoerciveArray (): void
1316+ {
1317+ // When
1318+ $ result = [];
1319+ foreach (Set::distinct ([0 , '0.0 ' , '0e0 ' , false ], false ) as $ datum ) {
1320+ $ result [] = $ datum ;
1321+ }
1322+
1323+ // Then
1324+ $ this ->assertCount (1 , $ result );
1325+ $ this ->assertSame (0 , $ result [0 ]);
1326+ }
1327+
12961328 /**
12971329 * @test distinct strict keeps scientific notation and equivalent integer separate
12981330 */
0 commit comments