aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-05-22 20:46:26 +0300
committerGitHub <noreply@github.com>2018-05-22 20:46:26 +0300
commit9ecd92c6fedd052f4115683726a5cc6ebaa33e85 (patch)
tree794a3df4990aa5397c7e284185b284bb956b6cb5 /run_unittests.py
parentf4194d4dbc5c48ff9a0d76c779876aab60754230 (diff)
parentfe6fc59ee75f44acdaac0abc757c687916d4618a (diff)
downloadmeson-9ecd92c6fedd052f4115683726a5cc6ebaa33e85.zip
meson-9ecd92c6fedd052f4115683726a5cc6ebaa33e85.tar.gz
meson-9ecd92c6fedd052f4115683726a5cc6ebaa33e85.tar.bz2
Merge pull request #3490 from MathieuDuponchelle/dict_builtin
Add new built-in type, dict
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):
'''