aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreterbase/decorators.py8
-rw-r--r--test cases/failing/116 run_target in test/test.json2
-rw-r--r--unittests/internaltests.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index 817cb85..8832d29 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -326,9 +326,9 @@ class ContainerTypeInfo:
:return: string to be printed
"""
- container = 'dict' if self.container is dict else 'list'
+ container = 'dict' if self.container is dict else 'array'
if isinstance(self.contains, tuple):
- contains = ','.join([t.__name__ for t in self.contains])
+ contains = ' | '.join([t.__name__ for t in self.contains])
else:
contains = self.contains.__name__
s = f'{container}[{contains}]'
@@ -471,8 +471,8 @@ def typed_kwargs(name: str, *types: KwargInfo) -> T.Callable[..., T.Any]:
"""describe a raw type (ie, one that is not a ContainerTypeInfo)."""
if isinstance(t, list):
if t:
- return f"list[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t)))}]"
- return 'list[]'
+ return f"array[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t)))}]"
+ return 'array[]'
elif isinstance(t, dict):
if t:
return f"dict[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t.values())))}]"
diff --git a/test cases/failing/116 run_target in test/test.json b/test cases/failing/116 run_target in test/test.json
index 7826ceb..e08aa03 100644
--- a/test cases/failing/116 run_target in test/test.json
+++ b/test cases/failing/116 run_target in test/test.json
@@ -1,7 +1,7 @@
{
"stdout": [
{
- "line": "test cases/failing/116 run_target in test/meson.build:4:0: ERROR: test keyword argument 'args' was of type list[RunTarget] but should have been list[str,File,BuildTarget,CustomTarget]"
+ "line": "test cases/failing/116 run_target in test/meson.build:4:0: ERROR: test keyword argument 'args' was of type array[RunTarget] but should have been array[str | File | BuildTarget | CustomTarget]"
}
]
}
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index 86c1890..93affb7 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -1266,7 +1266,7 @@ class InternalTests(unittest.TestCase):
with self.assertRaises(InvalidArguments) as cm:
_(None, mock.Mock(), [], {'input': {}})
- self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type dict[] but should have been list[str]")
+ self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type dict[] but should have been array[str]")
def test_typed_kwarg_contained_invalid(self) -> None:
@typed_kwargs(
@@ -1313,7 +1313,7 @@ class InternalTests(unittest.TestCase):
with self.assertRaises(MesonException) as cm:
_(None, mock.Mock(), [], {'input': ['a']})
- self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type list[str] but should have been list[str] that has even size")
+ self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type array[str] but should have been array[str] that has even size")
@mock.patch.dict(mesonbuild.mesonlib.project_meson_versions, {})
def test_typed_kwarg_since(self) -> None: