Diff for /gforth/regexp-test.fs between versions 1.8 and 1.10

version 1.8, 2010/09/04 11:51:09 version 1.10, 2010/09/04 21:39:29
Line 120  s" foofoofoo" ?foos1 Line 120  s" foofoofoo" ?foos1
   
 \ simple replacement test  \ simple replacement test
     
   ." --- delnum test ---" cr
   
 : delnum  ( addr u -- addr' u' )   s// \d s" " //g ;  : delnum  ( addr u -- addr' u' )   s// \d s" " //g ;
 : test-delnum  ( addr u addr' u' -- )  : test-delnum  ( addr u addr' u' -- )
    2swap delnum 2over 2over str= 0= IF     2swap delnum 2over 2over str= 0= IF
       ." test-delnum: got '" type ." ', expected '" type ." '"        ." test-delnum: got '" type ." ', expected '" type ." '"
    THEN ;     ELSE  2drop 2drop  THEN ;
 s" 0"  s" " test-delnum  s" 0"  s" " test-delnum
 s" 00"  s" " test-delnum  s" 00"  s" " test-delnum
 s" 0a"  s" a" test-delnum  s" 0a"  s" a" test-delnum
Line 133  s" aa"  s" aa" test-delnum Line 135  s" aa"  s" aa" test-delnum
   
 \ replacement tests  \ replacement tests
   
   ." --- replacement tests ---" cr
   
 : hms>s ( addr u -- addr' u' )  : hms>s ( addr u -- addr' u' )
   s// \( \d \d \) ` : \( \d \d \) ` : \( \d \d \)    s// \( \d \d \) ` : \( \d \d \) ` : \( \d \d \)
   \1 s>number drop 60 *    \1 s>number drop 60 *
   \2 s>number drop + 60 *    \2 s>number drop + 60 *
   \3 s>number drop + 0 <# 's' hold #s #> //g ;    \3 s>number drop + 0 <# 's' hold #s #> //g ;
   
 s" bla 12:34:56 fasel 00:01:57 blubber" hms>s  s" bla 12:34:56 fasel 00:01:57 blubber" 2dup type hms>s
 s" bla 45296s fasel 117s" str= 0= [IF] .( replacement failed) [THEN]  ."  replaced by " 2dup type
   s" bla 45296s fasel 117s blubber" str= [IF] .(  ok) [ELSE] .(  failed) [THEN] cr
   
 script? [IF] bye [THEN]  script? [IF] bye [THEN]

Removed from v.1.8  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>