diff options
Diffstat (limited to 'testsuite/systemtap.string')
-rw-r--r-- | testsuite/systemtap.string/tokenize.exp | 16 | ||||
-rw-r--r-- | testsuite/systemtap.string/tokenize.stp | 75 |
2 files changed, 62 insertions, 29 deletions
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 diff --git a/testsuite/systemtap.string/tokenize.stp b/testsuite/systemtap.string/tokenize.stp index 10703d90..1b253c8d 100644 --- a/testsuite/systemtap.string/tokenize.stp +++ b/testsuite/systemtap.string/tokenize.stp @@ -5,42 +5,61 @@ probe begin teststr3 = "1,,2,3, ,4" teststr4 = "" teststr5 = "this is a string with no delimiters" + teststr6 = "this is a string, which has two delimiters" tok = tokenize(teststr1, "|") while (tok != "") { - printf("%s\n", tok) + println(tok) tok = tokenize("", "|") } - tok = tokenize(teststr1, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", "|") - } + println("-") + + tok = tokenize(teststr1, ",") + while (tok != "") { + println(tok) + tok = tokenize("", "|") + } + println("-") + tok = tokenize(teststr2, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr3, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr4, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr5, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } + while (tok != "") { + println(tok) + tok = tokenize("", ",") + } + + println("-") + + tok = tokenize(teststr3, ",") + while (tok != "") { + println(tok) + tok = tokenize("", ",") + } + + println("-") + + tok = tokenize(teststr4, ",") + while (tok != "") { + println(tok) + tok = tokenize("", ",") + } + + println("-") + + tok = tokenize(teststr5, ",") + while (tok != "") { + println(tok) + tok = tokenize("", ",") + } + + println("-") + + tok = tokenize(teststr6, ", ") + while (tok != "") { + println(tok) + tok = tokenize("", ", ") + } exit() } |