Add one more pcre test

This commit is contained in:
c9s 2014-05-18 14:18:47 +08:00
parent 4871e91054
commit f4bb320470
4 changed files with 32 additions and 7 deletions

View file

@ -364,6 +364,16 @@ r3_include_HEADERS = \
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = r3.pc pkgconfig_DATA = r3.pc
EXTRA_DIST = \
autogen.sh \
bench.html \
demo.c \
gen_routes.rb \
HACKING.md \
LICENSE \
README.md \
$(NULL)
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive

View file

@ -13,6 +13,8 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \ am__make_running_with_option = \
@ -83,7 +85,8 @@ TESTS = check_tree$(EXEEXT) $(am__EXEEXT_1)
check_PROGRAMS = $(am__EXEEXT_2) check_PROGRAMS = $(am__EXEEXT_2)
subdir = tests subdir = tests
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(top_srcdir)/test-driver $(top_srcdir)/depcomp $(dist_noinst_DATA) $(noinst_HEADERS) \
$(top_srcdir)/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@ -160,6 +163,8 @@ am__can_run_installinfo = \
n|no|NO) false;; \ n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \ *) (install-info --version) >/dev/null 2>&1;; \
esac esac
DATA = $(dist_noinst_DATA)
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input, # Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is # and print each of them once, without duplicates. Input order is
@ -509,6 +514,14 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AM_CFLAGS = $(DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include \ AM_CFLAGS = $(DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include \
@CHECK_CFLAGS@ $(am__append_2) @CHECK_CFLAGS@ $(am__append_2)
noinst_HEADERS = \
bench.h \
$(NULL)
dist_noinst_DATA = \
bench_str.csv \
$(NULL)
@ENABLE_GRAPHVIZ_TRUE@check_gvc_SOURCES = check_gvc.c bench.c @ENABLE_GRAPHVIZ_TRUE@check_gvc_SOURCES = check_gvc.c bench.c
@ENABLE_GRAPHVIZ_TRUE@check_gvc_LDADD = $(GVC_DEPS_LIBS) $(DEPS_LIBS) -L$(top_builddir)/src -lr3 @CHECK_LIBS@ @ENABLE_GRAPHVIZ_TRUE@check_gvc_LDADD = $(GVC_DEPS_LIBS) $(DEPS_LIBS) -L$(top_builddir)/src -lr3 @CHECK_LIBS@
@ENABLE_GRAPHVIZ_TRUE@check_gvc_CFLAGS = $(GVC_DEPS_CFLAGS) $(DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include @CHECK_CFLAGS@ @ENABLE_GRAPHVIZ_TRUE@check_gvc_CFLAGS = $(GVC_DEPS_CFLAGS) $(DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include @CHECK_CFLAGS@
@ -923,7 +936,7 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am check: check-am
all-am: Makefile all-am: Makefile $(DATA) $(HEADERS)
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am

View file

@ -155,3 +155,5 @@
1400389287,11080291.51 1400389287,11080291.51
1400389343,11017300.69 1400389343,11017300.69
1400389511,11126324.77 1400389511,11126324.77
1400393822,10834745.34
1400393905,10709222.20

1 1400242718 5649455.80
155 1400389287 11080291.51
156 1400389343 11017300.69
157 1400389511 11126324.77
158 1400393822 10834745.34
159 1400393905 10709222.20

View file

@ -252,18 +252,18 @@ START_TEST(test_pcre_pattern_simple)
match_entry * entry; match_entry * entry;
entry = match_entry_createl( "/user/123" , strlen("/user/123") ); entry = match_entry_createl( "/user/123" , strlen("/user/123") );
n = r3_tree_create(10); node * n = r3_tree_create(10);
r3_tree_insert_pathl(n, "/user/{id}", strlen("/user/{id}"), NULL, NULL); r3_tree_insert_pathl(n, "/user/{id}", strlen("/user/{id}"), NULL, NULL);
r3_tree_insert_pathl(n, "/user", strlen("/user"), NULL, NULL); r3_tree_insert_pathl(n, "/user", strlen("/user"), NULL, NULL);
r3_tree_compile(n); r3_tree_compile(n);
r3_tree_dump(n, 0); r3_tree_dump(n, 0);
node *matched; node *matched;
matched = r3_tree_match(n , "/blog/post", strlen("/blog/post"), entry); matched = r3_tree_match(n, "/user/123", strlen("/user/123"), entry);
ck_assert_int_gt(entry->vars->len, 0);
ck_assert_str_eq(entry->vars->tokens[0],"123");
} }
END_TEST
START_TEST(test_insert_route) START_TEST(test_insert_route)
{ {