summary: Fix empty list case

Fixes: #6557.
pull/6568/head
Xavier Claessens 5 years ago committed by Xavier Claessens
parent 402f7afdb0
commit 31f00c11d3
  1. 2
      mesonbuild/interpreter.py
  2. 1
      run_unittests.py
  3. 1
      test cases/unit/72 summary/meson.build

@ -1783,6 +1783,8 @@ class Summary:
formatted_values.append(mlog.green('YES') if i else mlog.red('NO'))
else:
formatted_values.append(i)
if not formatted_values:
formatted_values = ['']
self.sections[section][k] = formatted_values
self.max_key_len = max(self.max_key_len, len(k))

@ -4254,6 +4254,7 @@ recommended as it is not supported on some platforms''')
A list: string
1
True
empty list:
A number: 1
yes: YES
no: NO

@ -7,6 +7,7 @@ summary({'Some boolean': false,
'Another boolean': true,
'Some string': 'Hello World',
'A list': ['string', 1, true],
'empty list': [],
}, section: 'Configuration')
summary('A number', 1, section: 'Configuration')
summary('yes', true, bool_yn : true, section: 'Configuration')

Loading…
Cancel
Save