diff --git a/testcases/insert_fn.mux b/testcases/insert_fn.mux index 3d29ed5cf..b868990ab 100644 --- a/testcases/insert_fn.mux +++ b/testcases/insert_fn.mux @@ -20,11 +20,11 @@ &tr.tc001 test_insert_fn= @if strmatch( setr(0,sha1( - insert(This is a test, 4, new) - [insert(Yet@Another@List, 3, Funk, @)] + [insert(This is a test, 4, new)] + [insert(Yet@Another@List, 3, Funky, @)] ) ), - 80194573F0E288397A859CD3A27CCF1FD922C8DB + 406626B7163831461CDED124D892909E9E351FCB )= { @log smoke=TC001: Help file examples. Succeeded. @@ -39,7 +39,7 @@ &tr.tc002 test_insert_fn= @if strmatch( setr(0,sha1( - iter(0 1 2,## [insert(,##,Pear,|)]) + [iter(0 1 2,## [insert(,##,Pear,|)])] ) ), 6A543151C6BDF80889FEAF3A53079DE952657E2A @@ -57,12 +57,12 @@ &tr.tc003 test_insert_fn= @if strmatch( setr(0,sha1( - iter(0 1 2 3,## [insert(|,##,Pear,|)]) - iter(0 1 2 3 4,## [insert(||,##,Pear,|)]) - iter(0 1 2 3 4 5,## [insert(|||,##,Pear,|)]) + [iter(0 1 2 3,## [insert(|,##,Pear,|)])] + [iter(0 1 2 3 4,## [insert(||,##,Pear,|)])] + [iter(0 1 2 3 4 5,## [insert(|||,##,Pear,|)])] ) ), - 86316ADB7ADA940BCB55F7EE8BF4DE5E0852D34C + 7CEB5283E8F723EF34A3468AE1CAD76D36517DCF )= { @log smoke=TC003: Non-empty lists, ASCII, positive positions. Succeeded. @@ -77,7 +77,7 @@ &tr.tc004 test_insert_fn= @if strmatch( setr(0,sha1( - iter(-2 -1,## [insert(,##,Pear,|)]) + [iter(-2 -1,## [insert(,##,Pear,|)])] ) ), FF317BAF06BA80EED00C1E604E5A94C16EADAA8F @@ -95,12 +95,12 @@ &tr.tc005 test_insert_fn= @if strmatch( setr(0,sha1( - iter(-3 -2 -1,## [insert(|,##,Pear,|)]) - iter(-4 -3 -2 -1,## [insert(||,##,Pear,|)]) - iter(-5 -4 -3 -2 -1,## [insert(|||,##,Pear,|)]) + [iter(-3 -2 -1,## [insert(|,##,Pear,|)])] + [iter(-4 -3 -2 -1,## [insert(||,##,Pear,|)])] + [iter(-5 -4 -3 -2 -1,## [insert(|||,##,Pear,|)])] ) ), - AA1255843386F29403032C2A238745291C562B90 + 377189E5484C2F769375C40A0540080FF649CE2F )= { @log smoke=TC005: Non-empty lists, ASCII, negative positions. Succeeded.; diff --git a/testcases/replace_fn.mux b/testcases/replace_fn.mux new file mode 100644 index 000000000..0c9804e8a --- /dev/null +++ b/testcases/replace_fn.mux @@ -0,0 +1,121 @@ +# +# replace_fn.mux - Test Cases for replace(). +# +# Strategy: Exercise color and UTF-8 in combination with replace() behaviors. +# +@create test_replace_fn +- +@set test_replace_fn=INHERIT QUIET +- +# +# Beginning of Test Cases +# +&tr.tc000 test_replace_fn= + @log smoke=Beginning replace() test cases. +- +# +# Test Case #1 - Help file examples. +# +&tr.tc001 test_replace_fn= + @if strmatch( + setr(0,sha1( + [replace(This is a test, 4, quiz)] + [insert(Yet@Another@Mundane@List, 3, Funky, @)] + ) + ), + 928F739D325B8C8882EE7C4E32E6D5764AA08626 + )= + { + @log smoke=TC001: Help file examples. Succeeded. + }, + { + @log smoke=TC001: Help file examples. Failed (%q0). + } +- +# +# Test Case #2 - Empty list. ASCII. Positive positions. +# +&tr.tc002 test_replace_fn= + @if strmatch( + setr(0,sha1( + [iter(0 1 2,## [replace(,##,Pear,|)])] + ) + ), + 6E58F1F3A34A9082AD078C3706E3067C0B22FE6E + )= + { + @log smoke=TC002: Empty list, ASCII, positive positions. Succeeded. + }, + { + @log smoke=TC002: Empty list, ASCII, positive positions. Failed (%q0). + } +- +# +# Test Case #3 - Non-empty lists. ASCII. Positive positions. +# +&tr.tc003 test_replace_fn= + @if strmatch( + setr(0,sha1( + [iter(0 1 2 3,## [replace(|,##,Pear,|)])] + [iter(0 1 2 3 4,## [replace(||,##,Pear,|)])] + [iter(0 1 2 3 4 5,## [replace(|||,##,Pear,|)])] + ) + ), + 40A8E0B4CA8FF2E2C9956AE9C09F9C68C8A16673 + )= + { + @log smoke=TC003: Non-empty lists, ASCII, positive positions. Succeeded. + }, + { + @log smoke=TC003: Non-empty lists, ASCII, positive positions. Failed (%q0). + } +- +# +# Test Case #4 - Empty list. ASCII. Negative positions. +# +&tr.tc004 test_replace_fn= + @if strmatch( + setr(0,sha1( + [iter(-2 -1,## [replace(,##,Pear,|)])] + ) + ), + 5F364FF7EEEC93E30C5709B5184501A17046BDEA + )= + { + @log smoke=TC004: Empty list, ASCII, negative positions. Succeeded. + }, + { + @log smoke=TC004: Empty list, ASCII, negative positions. Failed (%q0). + } +- +# +# Test Case #5 - Non-empty lists. ASCII. Negative positions. +# +&tr.tc005 test_replace_fn= + @if strmatch( + setr(0,sha1( + [iter(-3 -2 -1,## [replace(|,##,Pear,|)])] + [iter(-4 -3 -2 -1,## [replace(||,##,Pear,|)])] + [iter(-5 -4 -3 -2 -1,## [replace(|||,##,Pear,|)])] + ) + ), + 29B941B8D4EE1193E602E3DDB0ED55DA5F86EFC9 + )= + { + @log smoke=TC005: Non-empty lists, ASCII, negative positions. Succeeded.; + @trig me/tr.done + }, + { + @log smoke=TC005: Non-empty lists, ASCII, negative positions. Failed (%q0).; + @trig me/tr.done + } +- +&tr.done test_replace_fn= + @log smoke=End replace() test cases.; + @notify smoke +- +drop test_replace_fn +- +# +# End of Test Cases +# diff --git a/testcases/smoke.flat b/testcases/smoke.flat index 78b744dbf..936f3e23d 100644 --- a/testcases/smoke.flat +++ b/testcases/smoke.flat @@ -1,5 +1,5 @@ +X996100 -+S35 ++S36 +N273 -R1 +A256 @@ -40,7 +40,7 @@ "Limbo" -1 -1 -34 +35 -1 -1 -1 @@ -88,7 +88,7 @@ >84 "#1;127.0.0.1;Fri Jan 01 00:00:00 2010;;;;;;;0;0;;;;;;;" >213 -"-1 34 -1 -1 34" +"-1 35 -1 -1 35" >222 "Shutdown" >224 @@ -572,15 +572,15 @@ >256 "@log smoke=Beginning insert() test cases." >257 -"@if strmatch(setr(0,sha1(insert(This is a test, 4, new)[insert(Yet@Another@List, 3, Funk, @)])),80194573F0E288397A859CD3A27CCF1FD922C8DB)={@log smoke=TC001: Help file examples. Succeeded.},{@log smoke=TC001: Help file examples. Failed (%q0).}" +"@if strmatch(setr(0,sha1([insert(This is a test, 4, new)][insert(Yet@Another@List, 3, Funky, @)])),406626B7163831461CDED124D892909E9E351FCB)={@log smoke=TC001: Help file examples. Succeeded.},{@log smoke=TC001: Help file examples. Failed (%q0).}" >258 -"@if strmatch(setr(0,sha1(iter(0 1 2,## [insert(,##,Pear,|)]))),6A543151C6BDF80889FEAF3A53079DE952657E2A)={@log smoke=TC002: Empty list, ASCII, positive positions. Succeeded.},{@log smoke=TC002: Empty list, ASCII, positive positions. Failed (%q0).}" +"@if strmatch(setr(0,sha1([iter(0 1 2,## [insert(,##,Pear,|)])])),6A543151C6BDF80889FEAF3A53079DE952657E2A)={@log smoke=TC002: Empty list, ASCII, positive positions. Succeeded.},{@log smoke=TC002: Empty list, ASCII, positive positions. Failed (%q0).}" >260 -"@if strmatch(setr(0,sha1(iter(0 1 2 3,## [insert(|,##,Pear,|)])iter(0 1 2 3 4,## [insert(||,##,Pear,|)])iter(0 1 2 3 4 5,## [insert(|||,##,Pear,|)]))),86316ADB7ADA940BCB55F7EE8BF4DE5E0852D34C)={@log smoke=TC003: Non-empty lists, ASCII, positive positions. Succeeded.},{@log smoke=TC003: Non-empty lists, ASCII, positive positions. Failed (%q0).}" +"@if strmatch(setr(0,sha1([iter(0 1 2 3,## [insert(|,##,Pear,|)])][iter(0 1 2 3 4,## [insert(||,##,Pear,|)])][iter(0 1 2 3 4 5,## [insert(|||,##,Pear,|)])])),7CEB5283E8F723EF34A3468AE1CAD76D36517DCF)={@log smoke=TC003: Non-empty lists, ASCII, positive positions. Succeeded.},{@log smoke=TC003: Non-empty lists, ASCII, positive positions. Failed (%q0).}" >261 -"@if strmatch(setr(0,sha1(iter(-2 -1,## [insert(,##,Pear,|)]))),FF317BAF06BA80EED00C1E604E5A94C16EADAA8F)={@log smoke=TC004: Empty list, ASCII, negative positions. Succeeded.},{@log smoke=TC004: Empty list, ASCII, negative positions. Failed (%q0).}" +"@if strmatch(setr(0,sha1([iter(-2 -1,## [insert(,##,Pear,|)])])),FF317BAF06BA80EED00C1E604E5A94C16EADAA8F)={@log smoke=TC004: Empty list, ASCII, negative positions. Succeeded.},{@log smoke=TC004: Empty list, ASCII, negative positions. Failed (%q0).}" >262 -"@if strmatch(setr(0,sha1(iter(-3 -2 -1,## [insert(|,##,Pear,|)])iter(-4 -3 -2 -1,## [insert(||,##,Pear,|)])iter(-5 -4 -3 -2 -1,## [insert(|||,##,Pear,|)]))),AA1255843386F29403032C2A238745291C562B90)={@log smoke=TC005: Non-empty lists, ASCII, negative positions. Succeeded.;@trig me/tr.done},{@log smoke=TC005: Non-empty lists, ASCII, negative positions. Failed (%q0).;@trig me/tr.done}" +"@if strmatch(setr(0,sha1([iter(-3 -2 -1,## [insert(|,##,Pear,|)])][iter(-4 -3 -2 -1,## [insert(||,##,Pear,|)])][iter(-5 -4 -3 -2 -1,## [insert(|||,##,Pear,|)])])),377189E5484C2F769375C40A0540080FF649CE2F)={@log smoke=TC005: Non-empty lists, ASCII, negative positions. Succeeded.;@trig me/tr.done},{@log smoke=TC005: Non-empty lists, ASCII, negative positions. Failed (%q0).;@trig me/tr.done}" >259 "@log smoke=End insert() test cases.;@notify smoke" < @@ -856,7 +856,7 @@ "@log smoke=End pickrand() test cases.;@notify smoke" < !23 -"test_rest_fn" +"test_replace_fn" 0 -1 -1 @@ -876,6 +876,41 @@ >219 "Fri Jan 01 00:00:00 2010" >256 +"@log smoke=Beginning replace() test cases." +>257 +"@if strmatch(setr(0,sha1([replace(This is a test, 4, quiz)][insert(Yet@Another@Mundane@List, 3, Funky, @)])),928F739D325B8C8882EE7C4E32E6D5764AA08626)={@log smoke=TC001: Help file examples. Succeeded.},{@log smoke=TC001: Help file examples. Failed (%q0).}" +>258 +"@if strmatch(setr(0,sha1([iter(0 1 2,## [replace(,##,Pear,|)])])),6E58F1F3A34A9082AD078C3706E3067C0B22FE6E)={@log smoke=TC002: Empty list, ASCII, positive positions. Succeeded.},{@log smoke=TC002: Empty list, ASCII, positive positions. Failed (%q0).}" +>260 +"@if strmatch(setr(0,sha1([iter(0 1 2 3,## [replace(|,##,Pear,|)])][iter(0 1 2 3 4,## [replace(||,##,Pear,|)])][iter(0 1 2 3 4 5,## [replace(|||,##,Pear,|)])])),40A8E0B4CA8FF2E2C9956AE9C09F9C68C8A16673)={@log smoke=TC003: Non-empty lists, ASCII, positive positions. Succeeded.},{@log smoke=TC003: Non-empty lists, ASCII, positive positions. Failed (%q0).}" +>261 +"@if strmatch(setr(0,sha1([iter(-2 -1,## [replace(,##,Pear,|)])])),5F364FF7EEEC93E30C5709B5184501A17046BDEA)={@log smoke=TC004: Empty list, ASCII, negative positions. Succeeded.},{@log smoke=TC004: Empty list, ASCII, negative positions. Failed (%q0).}" +>262 +"@if strmatch(setr(0,sha1([iter(-3 -2 -1,## [replace(|,##,Pear,|)])][iter(-4 -3 -2 -1,## [replace(||,##,Pear,|)])][iter(-5 -4 -3 -2 -1,## [replace(|||,##,Pear,|)])])),29B941B8D4EE1193E602E3DDB0ED55DA5F86EFC9)={@log smoke=TC005: Non-empty lists, ASCII, negative positions. Succeeded.;@trig me/tr.done},{@log smoke=TC005: Non-empty lists, ASCII, negative positions. Failed (%q0).;@trig me/tr.done}" +>259 +"@log smoke=End replace() test cases.;@notify smoke" +< +!24 +"test_rest_fn" +0 +-1 +-1 +-1 +0 +23 +1 +-1 +1 +33556481 +0 +0 +0 +0 +>218 +"Fri Jan 01 00:00:00 2010" +>219 +"Fri Jan 01 00:00:00 2010" +>256 "@log smoke=Beginning rest() test cases." >257 "@if strmatch(setr(0,sha1([rest(This is a test)][rest(Would you like coffee, or perhaps tea)][rest(List!with!different!delimiters,!)])),948C7B2E7A1CB66F0BF5572D267B0D181B70764A)={@log smoke=TC001: rest examples. Succeeded.},{@log smoke=TC001: rest examples. Failed (%q0).}" @@ -896,14 +931,14 @@ >259 "@log smoke=End rest() test cases.;@notify smoke" < -!24 +!25 "test_rjust_fn" 0 -1 -1 -1 0 -23 +24 1 -1 1 @@ -931,14 +966,14 @@ >259 "@log smoke=End rjust() test cases.;@notify smoke" < -!25 +!26 "test_rpad_fn" 0 -1 -1 -1 0 -24 +25 1 -1 1 @@ -966,14 +1001,14 @@ >259 "@log smoke=End rpad() test cases.;@notify smoke" < -!26 +!27 "test_secure_fn" 0 -1 -1 -1 0 -25 +26 1 -1 1 @@ -999,14 +1034,14 @@ >259 "@log smoke=End secure() test cases.;@notify smoke" < -!27 +!28 "test_sha1_fn" 0 -1 -1 -1 0 -26 +27 1 -1 1 @@ -1030,14 +1065,14 @@ >259 "@log smoke=End sha1() test cases.;@notify smoke" < -!28 +!29 "test_shl_fn" 0 -1 -1 -1 0 -27 +28 1 -1 1 @@ -1061,14 +1096,14 @@ >259 "@log smoke=End shl() test cases.;@notify smoke" < -!29 +!30 "test_shuffle_fn" 0 -1 -1 -1 0 -28 +29 1 -1 1 @@ -1104,14 +1139,14 @@ >259 "@log smoke=End shuffle() test cases.;@notify smoke" < -!30 +!31 "test_shutdown" 0 -1 -1 -1 0 -29 +30 1 -1 1 @@ -1127,14 +1162,14 @@ >256 "@log smoke=Ending SmokeMUX;@notify smoke;@shutdown" < -!31 +!32 "test_sin_fn" 0 -1 -1 -1 0 -30 +31 1 -1 1 @@ -1154,14 +1189,14 @@ >259 "@log smoke=End sin() test cases.;@notify smoke" < -!32 +!33 "smoke" 0 -1 -1 -1 0 -31 +32 1 -1 1 @@ -1175,20 +1210,20 @@ >219 "Fri Jan 01 00:00:00 2010" >271 -"accent_fn atan2_fn center_fn cmd_say columns_fn convtime_fn cpad_fn digest_fn edit_fn elements_fn escape_fn extract_fn first_fn insert_fn last_fn ldelete_fn ljust_fn lpad_fn merge_fn mid_fn pickrand_fn rest_fn rjust_fn rpad_fn secure_fn sha1_fn shuffle_fn shl_fn sin_fn sqrt_fn wrap_fn shutdown" +"accent_fn atan2_fn center_fn cmd_say columns_fn convtime_fn cpad_fn digest_fn edit_fn elements_fn escape_fn extract_fn first_fn insert_fn last_fn ldelete_fn ljust_fn lpad_fn merge_fn mid_fn pickrand_fn replace_fn rest_fn rjust_fn rpad_fn secure_fn sha1_fn shuffle_fn shl_fn sin_fn sqrt_fn wrap_fn shutdown" >19 "@log smoke=Starting SmokeMUX;@drain me;@dolist v(suite.list)={@trig me/suite.tr=##};@notify me" >272 "@wait me={@dolist lattr(test_%0/tr.tc*)=@trig test_%0/##}" < -!33 +!34 "test_sqrt_fn" 0 -1 -1 -1 0 -32 +33 1 -1 1 @@ -1208,14 +1243,14 @@ >259 "@log smoke=End sqrt() test cases.;@notify smoke" < -!34 +!35 "test_wrap_fn" 0 -1 -1 -1 0 -33 +34 1 -1 1 diff --git a/testcases/smoke.mux b/testcases/smoke.mux index e860aa4df..8768a1449 100644 --- a/testcases/smoke.mux +++ b/testcases/smoke.mux @@ -11,7 +11,7 @@ center_fn cmd_say columns_fn convtime_fn cpad_fn digest_fn edit_fn elements_fn escape_fn extract_fn first_fn insert_fn last_fn ldelete_fn ljust_fn lpad_fn merge_fn mid_fn - pickrand_fn + pickrand_fn replace_fn rest_fn rjust_fn rpad_fn secure_fn sha1_fn shuffle_fn shl_fn sin_fn sqrt_fn wrap_fn shutdown -