@@ -479,15 +479,16 @@ def test_dot_complex_explicit(ndim):
479
479
480
480
481
481
@pytest .mark .skipif (not numpy_available , reason = "NumPy is not installed" )
482
- @pytest .mark .repeat (200 )
482
+ @pytest .mark .repeat (300 )
483
483
@pytest .mark .parametrize ("dtype" , ["uint16" , "uint32" ])
484
- def test_intersect (dtype ):
484
+ @pytest .mark .parametrize ("length_bound" , [10 , 25 , 1000 ])
485
+ def test_intersect (dtype , length_bound ):
485
486
"""Compares the simd.intersect() function with numpy.intersect1d."""
486
487
np .random .seed ()
487
- a_length = np .random .randint (1 , 1024 )
488
- b_length = np .random .randint (1 , 1024 )
489
- a = np .random .randint (2048 , size = a_length , dtype = dtype )
490
- b = np .random .randint (2048 , size = b_length , dtype = dtype )
488
+ a_length = np .random .randint (1 , length_bound )
489
+ b_length = np .random .randint (1 , length_bound )
490
+ a = np .random .randint (length_bound * 2 , size = a_length , dtype = dtype )
491
+ b = np .random .randint (length_bound * 2 , size = b_length , dtype = dtype )
491
492
492
493
# Remove duplicates, converting into sorted arrays
493
494
a = np .unique (a )
@@ -496,7 +497,7 @@ def test_intersect(dtype):
496
497
expected = baseline_intersect (a , b )
497
498
result = simd .intersect (a , b )
498
499
499
- assert int (expected ) == int (result )
500
+ assert int (expected ) == int (result ), f"Missing { np . intersect1d ( a , b ) } from { a } and { b } "
500
501
501
502
502
503
@pytest .mark .skipif (not numpy_available , reason = "NumPy is not installed" )
0 commit comments