The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
448 B
24 lines
448 B
7 years ago
|
project('dict test', 'c')
|
||
|
|
||
|
dict = {'foo' : 'bar',
|
||
|
'baz' : 'foo',
|
||
|
'foo bar': 'baz'}
|
||
|
|
||
|
exe = executable('prog', sources : ['prog.c'])
|
||
|
|
||
7 years ago
|
i = 0
|
||
|
|
||
7 years ago
|
foreach key, value : dict
|
||
|
test('dict test @0@'.format(key), exe,
|
||
|
args : [dict[key], value])
|
||
7 years ago
|
i += 1
|
||
7 years ago
|
endforeach
|
||
7 years ago
|
|
||
7 years ago
|
assert(i == 3, 'There should be three elements in that dictionary')
|
||
|
|
||
7 years ago
|
empty_dict = {}
|
||
|
|
||
|
foreach key, value : empty_dict
|
||
|
assert(false, 'This dict should be empty')
|
||
|
endforeach
|