[Mumps2Py:] [64] test files for the latest functionality.

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 64
Author:   pgallot
Date:     2008-01-28 20:57:01 +0000 (Mon, 28 Jan 2008)

Log Message:
-----------
test files for the latest functionality.

Added Paths:
-----------
    trunk/testfiles/for_justify.mps
    trunk/testfiles/for_piece.mps
    trunk/testfiles/for_piece_reverse.mps


Added: trunk/testfiles/for_justify.mps
===================================================================
--- trunk/testfiles/for_justify.mps	                        (rev 0)
+++ trunk/testfiles/for_justify.mps	2008-01-28 20:57:01 UTC (rev 64)
@@ -0,0 +1,5 @@
+ s x=10.9081726354
+ F i=0:1:12 W !,"[",$j(x,16,i),"]"
+ w !
+ s test="this is a test of string justification"
+ F i=$L(test):1:44 W !,"[",$j(test,i),"]"

Added: trunk/testfiles/for_piece.mps
===================================================================
--- trunk/testfiles/for_piece.mps	                        (rev 0)
+++ trunk/testfiles/for_piece.mps	2008-01-28 20:57:01 UTC (rev 64)
@@ -0,0 +1,17 @@
+ w !,!,"split out the numbers:",!
+ FOR i=1:1:5 WRITE !,$PIECE("1 2 3 4 5"," ",i),"<"
+
+ w !,!,"split out the number in groups of 2:",!
+ FOR i=1:1:4 WRITE !,$PIECE("1 2 3 4 5"," ",i,i+1),"<"
+
+ s x="this/is/a/test"
+ w !,!,x," split out the words:",!
+ F p=1:1:$L(x,"/") W $piece(x,"/",p)
+
+ w !,!,x," reverse the words:",!
+ F p=$L(x,"/"):-1:1 W $piece(x,"/",p)
+
+ s x="this/is/an/even/longer/test."
+ w !,!,x," split out the words in groups of 2.",!
+ F p=1:1:$L(x,"/")-1 W !,$piece(x,"/",p,p+1)
+

Added: trunk/testfiles/for_piece_reverse.mps
===================================================================
--- trunk/testfiles/for_piece_reverse.mps	                        (rev 0)
+++ trunk/testfiles/for_piece_reverse.mps	2008-01-28 20:57:01 UTC (rev 64)
@@ -0,0 +1,6 @@
+ s x="this is a rather long test"
+ w !,!,x,": reversed:",!
+ W $reverse(x),!
+ w !,!,x,": reversed piecemeal:",!
+ F p=$L(x," "):-1:1 W $re($piece(x," ",p))
+


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/