tests: Add glib-mkenums test for missing nicks

This adds a test to verify the change from issue #1360.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1360
This commit is contained in:
Philip Withnall 2018-05-02 13:25:11 +01:00
parent e8d755eb8e
commit 76083b6530

View File

@ -359,6 +359,20 @@ comment: {standard_bottom_comment}
# The output should be the same. # The output should be the same.
self.assertEqual(out1, out2) self.assertEqual(out1, out2)
def test_no_nick(self):
"""Test trigraphs with a desc but no nick. Issue #1360."""
h_contents = '''
typedef enum {
GEGL_SAMPLER_NEAREST = 0, /*< desc="nearest" >*/
} GeglSamplerType;
'''
(info, out, err, subs) = self.runMkenumsWithHeader(h_contents)
self.assertEqual('', err)
self.assertSingleEnum(out, subs, 'GeglSamplerType',
'gegl_sampler_type', 'GEGL_SAMPLER_TYPE',
'SAMPLER_TYPE', 'GEGL', 'enum', 'Enum',
'ENUM', 'GEGL_SAMPLER_NEAREST', 'nearest', '0')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(testRunner=taptestrunner.TAPTestRunner()) unittest.main(testRunner=taptestrunner.TAPTestRunner())