Merge pull request #136 from cxw42/tests-issue-131

Add tests of `struct class` (#131)
This commit is contained in:
Michael Opdenacker 2020-05-26 10:12:27 +02:00 committed by GitHub
commit b6606359e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View file

@ -92,6 +92,14 @@ run_produces_ok('ident query (existent)',
],
MUST_SUCCEED);
run_produces_ok('ident query (existent, #131)',
[$query_py, qw(v5.4 ident class C)],
[qr{^Symbol Definitions:}, qr{^Symbol References:},
qr{issue131\.h.+\b9\b.+\bstruct\b}, # def
qr{issue131\.h.+\b13} # refs
],
MUST_SUCCEED);
# Spot-check some files
run_produces_ok('file query (nonexistent)',

19
t/tree/issue131.h Normal file
View file

@ -0,0 +1,19 @@
/* This file triggers the bug described in #131. */
/**
* struct class - structure
* @member: A member
*
* Description.
*/
struct class {
int member;
};
void foo(struct class *klass)
{
klass->member = 42;
}
/* t/tree/issue131.c */
/* SPDX-License-Identifier: CC0-1.0 */