From 76083b6530fd48adc2ef3664b7d9b326a3479fc4 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 2 May 2018 13:25:11 +0100 Subject: [PATCH] tests: Add glib-mkenums test for missing nicks This adds a test to verify the change from issue #1360. Signed-off-by: Philip Withnall https://gitlab.gnome.org/GNOME/glib/issues/1360 --- gobject/tests/mkenums.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gobject/tests/mkenums.py b/gobject/tests/mkenums.py index a8820ae53..431453d01 100644 --- a/gobject/tests/mkenums.py +++ b/gobject/tests/mkenums.py @@ -359,6 +359,20 @@ comment: {standard_bottom_comment} # The output should be the same. 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__': unittest.main(testRunner=taptestrunner.TAPTestRunner())