aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Mikhirev2014-12-18 17:28:26 +0300
committerDmitry Mikhirev2014-12-18 17:28:26 +0300
commit68d50bc187209ea31fac0e640c50fc961c032790 (patch)
tree35ac1b58e385c7505981bce8366354aef54236a7
parent9d1296174974345d6ed6be338d9bbb56fdbda380 (diff)
downloadmake_pcre-68d50bc187209ea31fac0e640c50fc961c032790.tar.gz
make_pcre-68d50bc187209ea31fac0e640c50fc961c032790.tar.bz2
make_pcre-68d50bc187209ea31fac0e640c50fc961c032790.tar.xz
make_pcre-68d50bc187209ea31fac0e640c50fc961c032790.zip
more, more tests!
-rw-r--r--tests.mk37
1 files changed, 36 insertions, 1 deletions
diff --git a/tests.mk b/tests.mk
index 3f40808..47031c1 100644
--- a/tests.mk
+++ b/tests.mk
@@ -2,7 +2,7 @@ ifneq ($(findstring 4.,$(MAKE_VERSION)),4.)
$(error you need GNU make 4.x to run tests)
endif
-NUMTESTS = 25
+NUMTESTS = 30
tests := $(foreach num,$(shell seq -f%03g $(NUMTESTS)),test$(num))
load pcre.so
@@ -78,6 +78,41 @@ test023 = "$(s a,x,aaa,g)" = "xxx"
test024 = "$(s a(.),$(1),aaabac,g)" = "abc"
test025 = "$(s (?<var>.)a,$(var),aabaca,g)" = "abc"
+# test extended regexp
+define re026
+[abc] # comment
+[def] # comment
+endef
+test026 = "$(s $(re026),x,dadfbe,Egx)" = dxfx
+
+# test Unicode properties and UTF-8 support
+test027 = "$(s \w+,слово,тест тест,gu8)" = "слово слово"
+
+# test compilation error in pcre_subst and uncoupled brackets in message
+#load pcre.so
+#a := $(s (?a),b,a)
+#all:
+# @true
+test028 = -n "$(shell \
+ ( \
+ echo load\ pcre.so ; \
+ echo a\ :=\ \$$\(s\ \(?a\),b,a\) ; \
+ echo all: ; \
+ echo \ @true; \
+ ) | $(MAKE) -f - 2>&1 | \
+ fgrep \*\*\*\ s:\ 2:)"
+
+# test multi-line subject string
+define subj029
+test
+test
+endef
+test029 = -z "$(m ^test$,$(subj029))" -a "$(m ^test$,$(subj029),m)" = test
+
+# test `s' option
+test030 = -z "$(m test.test,$(subj029))" -a \
+ "$(s test.test,passed,$(subj029),s)" = passed
+
### END OF TEST EXPRESSIONS ###
test%: