Skip to content

Commit

Permalink
Add testcases for replace().
Browse files Browse the repository at this point in the history
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@5325 d1b986fa-651c-0410-a323-35a8662cf44d
  • Loading branch information
brazilofmux authored and brazilofmux committed May 29, 2011
1 parent 00eb5ae commit 947e593
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 46 deletions.
26 changes: 13 additions & 13 deletions testcases/insert_fn.mux
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.;
Expand Down
121 changes: 121 additions & 0 deletions 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
#

0 comments on commit 947e593

Please sign in to comment.