aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-14 15:36:16 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-22 09:12:54 -0700
commitdd296f321ba102052dcf3d0a67e4321752d560a2 (patch)
tree128a96df875cdcde36e3e647ec605866b5563270 /run_unittests.py
parenta024f432dd1cd406fa80334f63e91939536d3f79 (diff)
downloadmeson-dd296f321ba102052dcf3d0a67e4321752d560a2.zip
meson-dd296f321ba102052dcf3d0a67e4321752d560a2.tar.gz
meson-dd296f321ba102052dcf3d0a67e4321752d560a2.tar.bz2
interpreterbase: Add evolve to KwargInfo
This works just like OptionKey.evolve, pass new keyword arguments to override old ones, otherwise the original versions are copied to the new one.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index b55ba96..6ca1a81 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1698,6 +1698,18 @@ class InternalTests(unittest.TestCase):
_(None, mock.Mock(subproject=''), [], {'mode': 'since'})
self.assertRegex(out.getvalue(), r"""WARNING:.Project targeting '1.0'.*introduced in '1.1': "testfunc" keyword argument "mode" value "since".*""")
+ def test_typed_kwarg_evolve(self) -> None:
+ k = KwargInfo('foo', str, required=True, default='foo')
+ v = k.evolve(default='bar')
+ self.assertEqual(k.name, 'foo')
+ self.assertEqual(k.name, v.name)
+ self.assertEqual(k.types, str)
+ self.assertEqual(k.types, v.types)
+ self.assertEqual(k.required, True)
+ self.assertEqual(k.required, v.required)
+ self.assertEqual(k.default, 'foo')
+ self.assertEqual(v.default, 'bar')
+
@unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release')
class DataTests(unittest.TestCase):