File:  [gforth] / gforth / test / coremore.fs
Revision 1.1: download - view: text, annotated - select for diffs
Sat Oct 28 08:44:25 2006 UTC (13 years, 1 month ago) by anton
Branches: MAIN
CVS tags: HEAD
rearranged tests
added contrib/divspeed.fs by Krishna Myneni

    1: \ test some core stuff not tested by John Hayes' suite
    2: 
    3: \ Copyright (C) 2006 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 2
   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, write to the Free Software
   19: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
   20: 
   21: \ uses some non-core and non-standard words
   22: 
   23: require ./tester.fs
   24: decimal
   25: 
   26: \ division
   27: environment-wordlist >order
   28: { 1 1 dnegate 2 ' sm/rem catch 0= -> -1 max-n invert true }
   29: 
   30: { 1 1 -2 ' sm/rem catch 0= -> 1 max-n invert true }
   31: 
   32: { max-u max-n 2/ max-n invert ' fm/mod catch -> -1 max-n invert 0 }
   33: { max-u max-n 2/ max-n invert ' sm/rem catch -> max-n max-n negate 0 }
   34: 
   35: { 0 max-n 2/ 1+ max-n invert ' fm/mod catch -> 0 max-n invert 0 }
   36: { 0 max-n 2/ 1+ max-n invert ' sm/rem catch -> 0 max-n invert 0 }
   37: 
   38: { 1 max-n 2/ 1+ max-n invert ' sm/rem catch 0= -> 1 max-n invert true }
   39: 
   40: { 0 max-u -1. d+ max-u ' um/mod catch 0= -> max-u 1- max-u true }

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