From 68d50bc187209ea31fac0e640c50fc961c032790 Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Thu, 18 Dec 2014 17:28:26 +0300 Subject: more, more tests! --- tests.mk | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) 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 (?.)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%: -- cgit v1.2.1