aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/113 interpreter copy mutable var on assignment/meson.build
blob: 8b15357ad23d6a616d929a713d5b8bacd5156402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
project('foo', 'c')

a = configuration_data()
a.set('HELLO', 1)

b = a

assert(a.has('HELLO'), 'Original config data should be set on a')
assert(b.has('HELLO'), 'Original config data should be set on copy')

configure_file(output : 'b.h', configuration : b)

# This should still work, as we didn't use the original above but a copy!
a.set('WORLD', 1)

assert(a.has('WORLD'), 'New config data should have been set')
assert(not b.has('WORLD'), 'New config data set should not affect var copied earlier')

configure_file(output : 'a.h', configuration : a)