From 923b95f3d11141417f27ecbbf43b9ae849dc9e64 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Thu, 7 Sep 2023 15:06:23 -0400 Subject: Fix assertion raised with invalid option name When option name contains more that one dot, it should be detected earlier to prevent an assert to be raised. Fixes #11904. --- test cases/common/40 options/meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test cases') diff --git a/test cases/common/40 options/meson.build b/test cases/common/40 options/meson.build index a10ff28..de4a7d5 100644 --- a/test cases/common/40 options/meson.build +++ b/test cases/common/40 options/meson.build @@ -46,3 +46,11 @@ assert(get_option('wrap_mode') == 'default', 'Wrap mode option is broken.') assert(get_option('boolean_string') == false) assert(get_option('boolean_string2') == true) assert(get_option('integer_string') == 42) + +testcase expect_error('Invalid option name \'..invalid\'') + get_option('..invalid') +endtestcase + +testcase expect_error('Invalid option name \'this.is.also.invalid\'') + get_option('this.is.also.invalid') +endtestcase -- cgit v1.1