1.2.22. test/regress/rt-1.01.22

     1: #line 835 "./lpsrc/flx_regress.pak"
     2: //Check regmatch
Start felix section to test/regress/rt-1.01.22-0.flx[1 /1 ]
     3: // contrib by Valery, mod by Skaller
     4: #import <flx.flxh>
     5: 
     6: // emulate command line arguments
     7: arguments := "--test", "words", "more words";
     8: argc := 3;
     9: fun argv (i:int):string =>
    10:   match i with
    11:   | 0 .. 2 => arguments.[i]
    12:   | _ => ""
    13:   endmatch
    14: ;
    15: 
    16: var i = 0;
    17: whilst i < argc do
    18:   print "checking arg "; print i; print "="; print (argv i); endl;
    19:   regmatch (argv i) with
    20:   | "--test" => { print "test"; endl; }
    21:   | _*       => { print "terminating"; endl; i = argc; }
    22:   endmatch;
    23:   i++;
    24: done;
End felix section to test/regress/rt-1.01.22-0.flx[1]
Start data section to test/regress/rt-1.01.22-0.expect[1 /1 ]
     1: checking arg 0=--test
     2: test
     3: checking arg 1=words
     4: terminating
End data section to test/regress/rt-1.01.22-0.expect[1]