diff options
Diffstat (limited to 'lib/spack/spack/test/spec_syntax.py')
-rw-r--r-- | lib/spack/spack/test/spec_syntax.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/spack/spack/test/spec_syntax.py b/lib/spack/spack/test/spec_syntax.py index c9a2100b09..52a842912e 100644 --- a/lib/spack/spack/test/spec_syntax.py +++ b/lib/spack/spack/test/spec_syntax.py @@ -20,6 +20,7 @@ from spack.spec import AmbiguousHashError, InvalidHashError, NoSuchHashError from spack.spec import DuplicateArchitectureError from spack.spec import DuplicateDependencyError, DuplicateCompilerSpecError from spack.spec import SpecFilenameError, NoSuchSpecFileError +from spack.spec import MultipleVersionError from spack.variant import DuplicateVariantError @@ -149,6 +150,9 @@ class TestSpecSyntax(object): self.check_parse("openmpi ^hwloc ^libunwind", "openmpi^hwloc^libunwind") + def test_version_after_compiler(self): + self.check_parse('foo@2.0%bar@1.0', 'foo %bar@1.0 @2.0') + def test_dependencies_with_versions(self): self.check_parse("openmpi ^hwloc@1.2e6") self.check_parse("openmpi ^hwloc@1.2e6:") @@ -432,6 +436,17 @@ class TestSpecSyntax(object): ] self._check_raises(DuplicateVariantError, duplicates) + def test_multiple_versions(self): + multiples = [ + 'x@1.2@2.3', + 'x@1.2:2.3@1.4', + 'x@1.2@2.3:2.4', + 'x@1.2@2.3,2.4', + 'x@1.2 +foo~bar @2.3', + 'x@1.2%y@1.2@2.3:2.4', + ] + self._check_raises(MultipleVersionError, multiples) + def test_duplicate_dependency(self): self._check_raises(DuplicateDependencyError, ["x ^y ^y"]) |