dict: fix CI issues
This commit is contained in:
parent
f59d7bafd2
commit
10e7566ed8
|
@ -14,6 +14,6 @@ foo = dict.get('foo')
|
||||||
foobar = dict.get('foobar', 'fallback-value')
|
foobar = dict.get('foobar', 'fallback-value')
|
||||||
|
|
||||||
foreach key, value : dict
|
foreach key, value : dict
|
||||||
# Do something with key and value
|
Do something with key and value
|
||||||
#endforeach
|
endforeach
|
||||||
```
|
```
|
||||||
|
|
|
@ -300,7 +300,7 @@ class InterpreterBase:
|
||||||
|
|
||||||
def evaluate_dictstatement(self, cur):
|
def evaluate_dictstatement(self, cur):
|
||||||
(arguments, kwargs) = self.reduce_arguments(cur.args)
|
(arguments, kwargs) = self.reduce_arguments(cur.args)
|
||||||
assert (not arguments, 'parser bug, arguments should be empty')
|
assert (not arguments)
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
def evaluate_notstatement(self, cur):
|
def evaluate_notstatement(self, cur):
|
||||||
|
|
|
@ -657,7 +657,7 @@ class Parser:
|
||||||
a.commas.append(potential)
|
a.commas.append(potential)
|
||||||
else:
|
else:
|
||||||
raise ParseException('Only key:value pairs are valid in dict construction.',
|
raise ParseException('Only key:value pairs are valid in dict construction.',
|
||||||
self.getline(), s.lineno, s.colno)
|
self.getline(), s.lineno, s.colno)
|
||||||
s = self.statement()
|
s = self.statement()
|
||||||
return a
|
return a
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,6 @@ class BasePlatformTests(unittest.TestCase):
|
||||||
if inprocess:
|
if inprocess:
|
||||||
try:
|
try:
|
||||||
(returncode, out, err) = run_configure(self.meson_mainfile, self.meson_args + args + extra_args)
|
(returncode, out, err) = run_configure(self.meson_mainfile, self.meson_args + args + extra_args)
|
||||||
print (out)
|
|
||||||
if 'MESON_SKIP_TEST' in out:
|
if 'MESON_SKIP_TEST' in out:
|
||||||
raise unittest.SkipTest('Project requested skipping.')
|
raise unittest.SkipTest('Project requested skipping.')
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
|
@ -2331,13 +2330,13 @@ class FailureTests(BasePlatformTests):
|
||||||
|
|
||||||
def test_dict_requires_key_value_pairs(self):
|
def test_dict_requires_key_value_pairs(self):
|
||||||
self.assertMesonRaises("dict = {3, 'foo': 'bar'}",
|
self.assertMesonRaises("dict = {3, 'foo': 'bar'}",
|
||||||
'Only key:value pairs are valid in dict construction.')
|
'Only key:value pairs are valid in dict construction.')
|
||||||
self.assertMesonRaises("{'foo': 'bar', 3}",
|
self.assertMesonRaises("{'foo': 'bar', 3}",
|
||||||
'Only key:value pairs are valid in dict construction.')
|
'Only key:value pairs are valid in dict construction.')
|
||||||
|
|
||||||
def test_dict_forbids_duplicate_keys(self):
|
def test_dict_forbids_duplicate_keys(self):
|
||||||
self.assertMesonRaises("dict = {'a': 41, 'a': 42}",
|
self.assertMesonRaises("dict = {'a': 41, 'a': 42}",
|
||||||
'Duplicate dictionary key: a.*')
|
'Duplicate dictionary key: a.*')
|
||||||
|
|
||||||
|
|
||||||
class WindowsTests(BasePlatformTests):
|
class WindowsTests(BasePlatformTests):
|
||||||
|
|
Loading…
Reference in New Issue