Add one more pcre test
This commit is contained in:
parent
4871e91054
commit
f4bb320470
4 changed files with 32 additions and 7 deletions
10
Makefile.in
10
Makefile.in
|
@ -364,6 +364,16 @@ r3_include_HEADERS = \
|
|||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = r3.pc
|
||||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
bench.html \
|
||||
demo.c \
|
||||
gen_routes.rb \
|
||||
HACKING.md \
|
||||
LICENSE \
|
||||
README.md \
|
||||
$(NULL)
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
|
@ -83,7 +85,8 @@ TESTS = check_tree$(EXEEXT) $(am__EXEEXT_1)
|
|||
check_PROGRAMS = $(am__EXEEXT_2)
|
||||
subdir = tests
|
||||
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
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
|
@ -160,6 +163,8 @@ am__can_run_installinfo = \
|
|||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
DATA = $(dist_noinst_DATA)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
|
@ -509,6 +514,14 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
AM_CFLAGS = $(DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include \
|
||||
@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_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@
|
||||
|
@ -923,7 +936,7 @@ check-am: all-am
|
|||
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
all-am: Makefile $(DATA) $(HEADERS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
|
|
|
@ -155,3 +155,5 @@
|
|||
1400389287,11080291.51
|
||||
1400389343,11017300.69
|
||||
1400389511,11126324.77
|
||||
1400393822,10834745.34
|
||||
1400393905,10709222.20
|
||||
|
|
|
|
@ -252,18 +252,18 @@ START_TEST(test_pcre_pattern_simple)
|
|||
match_entry * entry;
|
||||
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", strlen("/user"), NULL, NULL);
|
||||
r3_tree_compile(n);
|
||||
r3_tree_dump(n, 0);
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue