File:  [gforth] / gforth / test / search.fs
Revision 1.4: download - view: text, annotated - select for diffs
Fri Dec 31 18:09:02 2010 UTC (8 years, 9 months ago) by anton
Branches: MAIN
CVS tags: HEAD
updated copyright years

    1: \ test search order wordset partially
    2: 
    3: \ Copyright (C) 2007,2010 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation, either version 3
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU General Public License for more details.
   16: 
   17: \ You should have received a copy of the GNU General Public License
   18: \ along with this program. If not, see http://www.gnu.org/licenses/.
   19: 
   20: require ./tester.fs
   21: 
   22: testing search order wordset
   23: decimal
   24: 
   25: : test-set-order0 ( c-addr u -- n )
   26:     2>r get-order 2r> 0 set-order ['] evaluate catch dup if
   27:         nip nip then
   28:     >r set-order r> ;
   29: 
   30: : test-set-order1 ( c-addr u wid -- n )
   31:     2>r get-order 2r> forth-wordlist 1 set-order ['] evaluate catch dup if
   32:         nip nip then
   33:     >r set-order r> ;
   34: 
   35: { s" order"      test-set-order0 -> -13 }
   36: { s" 5e"         test-set-order0 -> 0 5e }
   37: { s" root +"     test-set-order1 -> -13 }
   38: { s" root forth" test-set-order1 -> 0 }
   39: 

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