aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-07-17 13:54:56 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2018-10-04 20:14:37 -0400
commitfa2e096aa00175b12dd3fa9e9adf4879637ee83e (patch)
tree9cc3bae5a841335486ac701aa3cd58f0588d585a /test cases
parent2ff69b20df0864182fdf2b146d29dc67d0cb9a5b (diff)
downloadmeson-fa2e096aa00175b12dd3fa9e9adf4879637ee83e.zip
meson-fa2e096aa00175b12dd3fa9e9adf4879637ee83e.tar.gz
meson-fa2e096aa00175b12dd3fa9e9adf4879637ee83e.tar.bz2
Interpreter: Add "in" and "not in" operators
Closes: #3600
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/17 comparison/meson.build15
1 files changed, 15 insertions, 0 deletions
diff --git a/test cases/common/17 comparison/meson.build b/test cases/common/17 comparison/meson.build
index fb641ed..bba0168 100644
--- a/test cases/common/17 comparison/meson.build
+++ b/test cases/common/17 comparison/meson.build
@@ -137,3 +137,18 @@ assert(2 != 'st', 'not equal')
assert(not ([] == 'st'), 'not equal')
assert(not ([] == 1), 'not equal')
assert(not (2 == 'st'), 'not equal')
+
+# "in" and "not in" operators
+
+assert(1 in [1, 2], '''1 should be in [1, 2]''')
+assert(3 not in [1, 2], '''3 shouldn't be in [1, 2]''')
+assert(not (3 in [1, 2]), '''3 shouldn't be in [1, 2]''')
+
+assert('b' in ['a', 'b'], ''''b' should be in ['a', 'b']''')
+assert('c' not in ['a', 'b'], ''''c' shouldn't be in ['a', 'b']''')
+
+assert(exe1 in [exe1, exe2], ''''exe1 should be in [exe1, exe2]''')
+assert(exe3 not in [exe1, exe2], ''''exe3 shouldn't be in [exe1, exe2]''')
+
+assert('a' in {'a': 'b'}, '''1 should be in {'a': 'b'}''')
+assert('b' not in {'a': 'b'}, '''1 should be in {'a': 'b'}''')