diff options
author | Michael Hirsch <scivision@users.noreply.github.com> | 2020-06-15 00:14:20 -0400 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-06-15 10:06:34 -0700 |
commit | 0b9e8e39dd492f175679e5caab79eb8f251b6ca9 (patch) | |
tree | 5b44d16e1a6fd6acd4671d5412ac6e20e3f91cce /run_unittests.py | |
parent | 4ba06fb4ddf2f314ad8bb384bf8b7e65ef73c95e (diff) | |
download | meson-0b9e8e39dd492f175679e5caab79eb8f251b6ca9.zip meson-0b9e8e39dd492f175679e5caab79eb8f251b6ca9.tar.gz meson-0b9e8e39dd492f175679e5caab79eb8f251b6ca9.tar.bz2 |
environment: fallback regex for versions like 2020.01
add four-digit version unit_test cases
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/run_unittests.py b/run_unittests.py index 170df88..41ae710 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -40,7 +40,7 @@ from contextlib import contextmanager from glob import glob from pathlib import (PurePath, Path) from distutils.dir_util import copy_tree -import typing +import typing as T import mesonbuild.mlog import mesonbuild.depfile @@ -312,8 +312,14 @@ class InternalTests(unittest.TestCase): self.assertEqual(searchfunc('1.2.3'), '1.2.3') self.assertEqual(searchfunc('foobar 2016.10.28 1.2.3'), '1.2.3') self.assertEqual(searchfunc('2016.10.28 1.2.3'), '1.2.3') - self.assertEqual(searchfunc('foobar 2016.10.128'), 'unknown version') - self.assertEqual(searchfunc('2016.10.128'), 'unknown version') + self.assertEqual(searchfunc('foobar 2016.10.128'), '2016.10.128') + self.assertEqual(searchfunc('2016.10.128'), '2016.10.128') + self.assertEqual(searchfunc('2016.10'), '2016.10') + self.assertEqual(searchfunc('2016.10 1.2.3'), '1.2.3') + self.assertEqual(searchfunc('oops v1.2.3'), '1.2.3') + self.assertEqual(searchfunc('2016.oops 1.2.3'), '1.2.3') + self.assertEqual(searchfunc('2016.x'), 'unknown version') + def test_mode_symbolic_to_bits(self): modefunc = mesonbuild.mesonlib.FileMode.perms_s_to_bits @@ -7768,7 +7774,7 @@ class CrossFileTests(BasePlatformTests): """ def _cross_file_generator(self, *, needs_exe_wrapper: bool = False, - exe_wrapper: typing.Optional[typing.List[str]] = None) -> str: + exe_wrapper: T.Optional[T.List[str]] = None) -> str: if is_windows(): raise unittest.SkipTest('Cannot run this test on non-mingw/non-cygwin windows') if is_sunos(): |