From 7f12f9a3f6aeb2452acedced5a54c66c4a19382b Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Thu, 18 Jun 2009 01:50:31 +0200 Subject: Fix tokenize function and test. Previous implementation was error-prone, because allowed returning empty tokens (mimiced strsep()), which is fine if there is a NULL semantic. Unfortunately SystemTap doesn't provide it in scripts and has only blank string (""), therefore testing against it was misleading. The solution is to return only non-empty tokens (mimic strtok()). * tapset/string.stp: Fix tokenize. * testsuite/systemtap.string/tokenize.stp: Improve and add case with more than one delimiter in the delim string. * testsuite/systemtap.string/tokenize.exp: Ditto. * stapfuncs.3stap.in: Update tokenize description. * doc/langref.tex: Ditto. Signed-off-by: Josh Stone --- testsuite/systemtap.string/tokenize.exp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'testsuite/systemtap.string/tokenize.exp') diff --git a/testsuite/systemtap.string/tokenize.exp b/testsuite/systemtap.string/tokenize.exp index 697b7c7e..aa28f855 100644 --- a/testsuite/systemtap.string/tokenize.exp +++ b/testsuite/systemtap.string/tokenize.exp @@ -9,7 +9,9 @@ seven eight nine ten +- one|two|three|four|five|six|seven|eight|nine|ten +- a b c @@ -17,10 +19,22 @@ d e f g +- 1 2 3 4 -this is a string with no delimiters} +- +- +this is a string with no delimiters +- +this +is +a +string +which +has +two +delimiters} stap_run2 $srcdir/$subdir/$test.stp -- cgit