diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2018-07-18 09:57:34 -0400 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-14 23:46:42 +0300 |
| commit | 4f088365e49d28e0d413d42eb024c3ff6cbfee35 (patch) | |
| tree | 819356912328d5ffd278fbad2f63bc29b2d12e11 /test cases/common | |
| parent | 219dec39c09789f2b296e5af00305fe05fa3362b (diff) | |
| download | meson-4f088365e49d28e0d413d42eb024c3ff6cbfee35.tar.gz | |
interpreter: Add support for dict addition
Diffstat (limited to 'test cases/common')
| -rw-r--r-- | test cases/common/197 dict/meson.build | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test cases/common/197 dict/meson.build b/test cases/common/197 dict/meson.build index e1ee2e33b..41eea3193 100644 --- a/test cases/common/197 dict/meson.build +++ b/test cases/common/197 dict/meson.build @@ -21,3 +21,15 @@ empty_dict = {} foreach key, value : empty_dict assert(false, 'This dict should be empty') endforeach + +d1 = empty_dict + {'a' : 'b'} +assert(d1 == {'a' : 'b'}, 'dict addition is not working') + +d2 = d1 + {'a' : 'b2', 'c' : 'd'} +assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict addition is not working') +assert(d1 == {'a' : 'b'}, 'dict should be immutable') + +d3 = d2 +d3 += {'e' : 'f'} +assert(d3 == {'a' : 'b2', 'c' : 'd', 'e' : 'f'}, 'dict plusassign is not working') +assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict should be immutable') |
