Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added test case for jumping to the member of a wrong structure.
  • Loading branch information
llorens committed Jun 27, 2010
1 parent 3899005 commit 48795c1
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SmartTagTest/Rules.mk
Expand Up @@ -7,6 +7,9 @@ VIM_TEST_SCRIPT := $(dir)/SmartTagTest.vim
dir := $(d)/TestTags
include $(dir)/Rules.mk

dir := $(d)/wrong-type-member
include $(dir)/Rules.mk

d := $(dirstack_$(sp))
sp := $(basename $(sp))

Expand Down
1 change: 1 addition & 0 deletions SmartTagTest/run-tests.vim
Expand Up @@ -5,6 +5,7 @@
let testFiles = [
\ "TestTags/TestTags.cpp"
\ , "TestTags/TestTags.h"
\ , "wrong-type-member/file.c"
\ ]

set runtimepath=..
Expand Down
11 changes: 11 additions & 0 deletions SmartTagTest/wrong-type-member/Rules.mk
@@ -0,0 +1,11 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)

LOCAL_TEST_CASES := $(d)/file.c-test
ALL_TEST_CASES := $(ALL_TEST_CASES) $(LOCAL_TEST_CASES)

d := $(dirstack_$(sp))
sp := $(basename $(sp))

# vim: ft=make isfname-== noet
5 changes: 5 additions & 0 deletions SmartTagTest/wrong-type-member/aheader.h
@@ -0,0 +1,5 @@
struct SBar {
// MBar:
int m1;
};
/* vim: set ft=c ts=4 noet :*/
5 changes: 5 additions & 0 deletions SmartTagTest/wrong-type-member/bheader.h
@@ -0,0 +1,5 @@
struct SFoo {
// MFoo:
int m1;
};
/* vim: set ft=c ts=4 noet :*/
14 changes: 14 additions & 0 deletions SmartTagTest/wrong-type-member/file.c
@@ -0,0 +1,14 @@
#include <aheader.h>
#include <bheader.h>

struct SQuux {
struct SFoo *pFoo;
};

void func()
{
struct SQuux quux;
// #MFoo
quux.pFoo->m1;
}
/* vim: set ft=c ts=4 noet :*/
13 changes: 13 additions & 0 deletions SmartTagTest/wrong-type-member/tags
@@ -0,0 +1,13 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
SBar aheader.h /^struct SBar {$/;" s
SFoo bheader.h /^struct SFoo {$/;" s
SQuux file.c /^struct SQuux {$/;" s file:
func file.c /^void func()$/;" f
m1 aheader.h /^ int m1;$/;" m struct:SBar
m1 bheader.h /^ int m1;$/;" m struct:SFoo
pFoo file.c /^ struct SFoo *pFoo;$/;" m struct:SQuux typeref:struct:SQuux::SFoo file:

0 comments on commit 48795c1

Please sign in to comment.