@@ -328,7 +328,9 @@ def test_constraining_abstract_specs_with_empty_intersection(self, lhs, rhs):
328328 ("mpich" , "mpich~~foo" , True ),
329329 ("mpich" , "mpich foo==1" , True ),
330330 # Flags semantics is currently different from other variant
331- # ("mpich", 'mpich cppflags="-O3"', False),
331+ ("mpich" , 'mpich cflags="-O3"' , True ),
332+ ("mpich cflags=-O3" , 'mpich cflags="-O3 -Ofast"' , False ),
333+ ("mpich cflags=-O2" , 'mpich cflags="-O3"' , False ),
332334 ("multivalue-variant foo=bar" , "multivalue-variant +foo" , False ),
333335 ("multivalue-variant foo=bar" , "multivalue-variant ~foo" , False ),
334336 ("multivalue-variant fee=bar" , "multivalue-variant fee=baz" , False ),
@@ -457,22 +459,18 @@ def test_copy_satisfies_transitive(self):
457459 assert s .satisfies (copy [s .name ])
458460 assert copy [s .name ].satisfies (s )
459461
460- def test_satisfies_virtual (self ):
461- # Don't use check_satisfies: it checks constrain() too, and
462- # you can't constrain a non-virtual by a virtual.
462+ def test_intersects_virtual (self ):
463463 assert Spec ("mpich" ).intersects (Spec ("mpi" ))
464464 assert Spec ("mpich2" ).intersects (Spec ("mpi" ))
465465 assert Spec ("zmpi" ).intersects (Spec ("mpi" ))
466466
467- def test_satisfies_virtual_dep_with_virtual_constraint (self ):
468- """Ensure we can satisfy virtual constraints when there are multiple
469- vdep providers in the specs."""
467+ def test_intersects_virtual_dep_with_virtual_constraint (self ):
470468 assert Spec ("netlib-lapack ^openblas" ).intersects ("netlib-lapack ^openblas" )
471469 assert not Spec ("netlib-lapack ^netlib-blas" ).intersects ("netlib-lapack ^openblas" )
472470 assert not Spec ("netlib-lapack ^openblas" ).intersects ("netlib-lapack ^netlib-blas" )
473471 assert Spec ("netlib-lapack ^netlib-blas" ).intersects ("netlib-lapack ^netlib-blas" )
474472
475- def test_satisfies_same_spec_with_different_hash (self ):
473+ def test_intersectable_concrete_specs_must_have_the_same_hash (self ):
476474 """Ensure that concrete specs are matched *exactly* by hash."""
477475 s1 = Spec ("mpileaks" ).concretized ()
478476 s2 = s1 .copy ()
@@ -1195,15 +1193,15 @@ def test_package_hash_affects_dunder_and_dag_hash(mock_packages, default_mock_co
11951193 assert a1 .process_hash () != a2 .process_hash ()
11961194
11971195
1198- def test_satisfies_is_commutative_with_concrete_specs (default_mock_concretization ):
1196+ def test_intersects_and_satisfies_on_concretized_spec (default_mock_concretization ):
1197+ """Test that a spec obtained by concretizing an abstract spec, satisfies the abstract spec
1198+ but not vice-versa.
1199+ """
11991200 a1 = default_mock_concretization (
"[email protected] " )
1200120112011202
1202- # Spec.intersects is commutative.
12031203 assert a1 .intersects (a2 )
12041204 assert a2 .intersects (a1 )
1205-
1206- # Spec.satisfies means set inclusion, which is not commutative.
12071205 assert a1 .satisfies (a2 )
12081206 assert not a2 .satisfies (a1 )
12091207
0 commit comments