aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 3608d3e..b581e12 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2328,6 +2328,20 @@ class FailureTests(BasePlatformTests):
self.assertEqual(cm.exception.returncode, 2)
self.wipe()
+ def test_dict_requires_key_value_pairs(self):
+ self.assertMesonRaises("dict = {3, 'foo': 'bar'}",
+ 'Only key:value pairs are valid in dict construction.')
+ self.assertMesonRaises("{'foo': 'bar', 3}",
+ 'Only key:value pairs are valid in dict construction.')
+
+ def test_dict_forbids_duplicate_keys(self):
+ self.assertMesonRaises("dict = {'a': 41, 'a': 42}",
+ 'Duplicate dictionary key: a.*')
+
+ def test_dict_forbids_integer_key(self):
+ self.assertMesonRaises("dict = {3: 'foo'}",
+ 'Key must be a string.*')
+
class WindowsTests(BasePlatformTests):
'''