aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/228 add dict variable key/meson.build
blob: b39c17e02f1576d76dbc6c999a0a72e32a0d5fbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
project('add dictionary entry using string variable as key', meson_version: '>=0.52')

dict = {}

# A variable to be used as a key
key = 'myKey'

# Add new entry using the variable
dict += {key : 'myValue'}

# Test that the stored value is correct 
assert(dict[key] == 'myValue', 'Incorrect value retrieved from dictionary')