fixed spec syntax test
This commit is contained in:
parent
63459ab0c7
commit
19c8a52fe1
1 changed files with 8 additions and 1 deletions
|
@ -58,7 +58,7 @@ class SpecSyntaxTest(unittest.TestCase):
|
||||||
# ================================================================================
|
# ================================================================================
|
||||||
# Parse checks
|
# Parse checks
|
||||||
# ================================================================================
|
# ================================================================================
|
||||||
def check_parse(self, expected, spec=None):
|
def check_parse(self, expected, spec=None, remove_arch=True):
|
||||||
"""Assert that the provided spec is able to be parsed.
|
"""Assert that the provided spec is able to be parsed.
|
||||||
If this is called with one argument, it assumes that the string is
|
If this is called with one argument, it assumes that the string is
|
||||||
canonical (i.e., no spaces and ~ instead of - for variants) and that it
|
canonical (i.e., no spaces and ~ instead of - for variants) and that it
|
||||||
|
@ -70,6 +70,13 @@ def check_parse(self, expected, spec=None):
|
||||||
if spec is None:
|
if spec is None:
|
||||||
spec = expected
|
spec = expected
|
||||||
output = spack.spec.parse(spec)
|
output = spack.spec.parse(spec)
|
||||||
|
|
||||||
|
# Remove architectures that get added by parser.
|
||||||
|
if remove_arch:
|
||||||
|
for spec in output:
|
||||||
|
for s in spec.traverse():
|
||||||
|
s.architecture = None
|
||||||
|
|
||||||
parsed = (" ".join(str(spec) for spec in output))
|
parsed = (" ".join(str(spec) for spec in output))
|
||||||
self.assertEqual(expected, parsed)
|
self.assertEqual(expected, parsed)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue