Specs add a space before dependencies (#7942)
fixes #7941 Modified string representation of Specs to add a space before deps Unit-tests have been modified accordingly Added a test for regression on #7941
This commit is contained in:
parent
506f8e9f3e
commit
ff3205d21e
3 changed files with 45 additions and 26 deletions
|
@ -524,3 +524,16 @@ def test_regression_issue_7705(self):
|
||||||
s.concretize()
|
s.concretize()
|
||||||
|
|
||||||
assert not s.package.provides('lapack')
|
assert not s.package.provides('lapack')
|
||||||
|
|
||||||
|
@pytest.mark.regression('7941')
|
||||||
|
def test_regression_issue_7941(self):
|
||||||
|
# The string representation of a spec containing
|
||||||
|
# an explicit multi-valued variant and a dependency
|
||||||
|
# might be parsed differently than the originating spec
|
||||||
|
s = Spec('a foobar=bar ^b')
|
||||||
|
t = Spec(str(s))
|
||||||
|
|
||||||
|
s.concretize()
|
||||||
|
t.concretize()
|
||||||
|
|
||||||
|
assert s.dag_hash() == t.dag_hash()
|
||||||
|
|
|
@ -94,7 +94,7 @@ class TestSpecSyntax(object):
|
||||||
# Parse checks
|
# Parse checks
|
||||||
# ========================================================================
|
# ========================================================================
|
||||||
|
|
||||||
def check_parse(self, expected, spec=None, remove_arch=True):
|
def check_parse(self, expected, spec=None):
|
||||||
"""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
|
If this is called with one argument, it assumes that the
|
||||||
|
@ -153,7 +153,11 @@ def test_anonymous_specs_with_multiple_parts(self):
|
||||||
|
|
||||||
def test_simple_dependence(self):
|
def test_simple_dependence(self):
|
||||||
self.check_parse("openmpi ^hwloc")
|
self.check_parse("openmpi ^hwloc")
|
||||||
|
self.check_parse("openmpi ^hwloc", "openmpi^hwloc")
|
||||||
|
|
||||||
self.check_parse("openmpi ^hwloc ^libunwind")
|
self.check_parse("openmpi ^hwloc ^libunwind")
|
||||||
|
self.check_parse("openmpi ^hwloc ^libunwind",
|
||||||
|
"openmpi^hwloc^libunwind")
|
||||||
|
|
||||||
def test_dependencies_with_versions(self):
|
def test_dependencies_with_versions(self):
|
||||||
self.check_parse("openmpi ^hwloc@1.2e6")
|
self.check_parse("openmpi ^hwloc@1.2e6")
|
||||||
|
@ -173,6 +177,8 @@ def test_multiple_specs_long_second(self):
|
||||||
self.check_parse('mvapich emacs@1.1.1%intel cflags="-O3"',
|
self.check_parse('mvapich emacs@1.1.1%intel cflags="-O3"',
|
||||||
'mvapich emacs @1.1.1 %intel cflags=-O3')
|
'mvapich emacs @1.1.1 %intel cflags=-O3')
|
||||||
self.check_parse('mvapich cflags="-O3 -fPIC" emacs ^ncurses%intel')
|
self.check_parse('mvapich cflags="-O3 -fPIC" emacs ^ncurses%intel')
|
||||||
|
self.check_parse('mvapich cflags="-O3 -fPIC" emacs ^ncurses%intel',
|
||||||
|
'mvapich cflags="-O3 -fPIC" emacs^ncurses%intel')
|
||||||
|
|
||||||
def test_full_specs(self):
|
def test_full_specs(self):
|
||||||
self.check_parse(
|
self.check_parse(
|
||||||
|
|
Loading…
Reference in a new issue