Changeset 168 for trunk/thune/tests

Show
Ignore:
Timestamp:
06/05/06 03:23:01 (3 years ago)
Author:
krobillard
Message:

Thune -

'set can now assign a block of words from a series.
Implemented 'foreach as a function.
Boot.c is now built from mkboot.t script.

Location:
trunk/thune/tests
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/tests/Makefile

    r5 r168  
    11# Makefile  
     2 
     3.PHONY: grind clean 
    24 
    35test: 
    46        @./run_test working/*.t 
    57 
     8grind: 
     9        @./grind working/*.t 
     10 
    611clean: 
    712        @rm -f working/*.out 
  • trunk/thune/tests/working/control.good

    r19 r168  
     1--- while 0 --- 
    120 
    231 
    342 
    4 done 
     5--- loop 0 --- 
    560 
    671 
     
    13148 
    14159 
    15 done 
     16--- foreach 0 --- 
     17--- foreach 1 --- 
     18 1 
     19 2 
     20 a 
     21 b 
     22 one 
     23 two 
     24 tree 
     25--- foreach 2 --- 
     26 1 2 
     27 a b 
     28 one two 
     29 tree none 
     30--- foreach 3 --- 
     31 1 2 a 
     32 b one two 
     33 tree none none 
     34--- foreach 8 --- 
     35 1 2 a b one two tree none 
     36Tests done 
  • trunk/thune/tests/working/control.t

    r152 r168  
    11; Control flow test 
    22 
     3 
     4"--- while 0 ---" print 
    350 :n 
    46[n dup . 1 add :n] [n 3 lt?] while 
    5 "done" print 
    67 
    78 
     9"--- loop 0 ---" print 
    8100 :n 
    911[n dup . 1 add :n] 10 loop 
    10 "done" print 
    1112 
     13 
     14[[" " prin first reduce prin] iter eol prin] proc :rprint     ; (block -- ) 
     15 
     16[1 2 'a 'b "one" "two" "tree"] :data 
     17 
     18"--- foreach 0 ---" print 
     19data tail [a] [[a] rprint] foreach 
     20 
     21"--- foreach 1 ---" print 
     22data [a] [[a] rprint] foreach 
     23 
     24"--- foreach 2 ---" print 
     25data [a b] [[a b] rprint] foreach 
     26 
     27"--- foreach 3 ---" print 
     28data [a b c] [[a b c] rprint] foreach 
     29 
     30"--- foreach 8 ---" print 
     31data [a b c d e f g h] [[a b c d e f g h] rprint] foreach 
     32 
     33 
     34"Tests done" print