"Fossies" - the Fresh Open Source Software Archive

Member "bas-2.6/test/test42" (2 Jul 2019, 424 Bytes) of package /linux/privat/bas-2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test42": 2.5_vs_2.6.

    1 #!/bin/sh
    2 
    3 echo -n $0: 'Arithmetic... '
    4 
    5 cat >test.bas <<eof
    6 10 print 4.7\3
    7 20 print -2.3\1
    8 30 print int(-2.3)
    9 40 print int(2.3)
   10 50 print fix(-2.3)
   11 60 print fix(2.3)
   12 70 print fp(-2.3)
   13 80 print fp(2.3)
   14 90 print -2^-3.5
   15 eof
   16 
   17 cat >test.ref <<eof
   18  1 
   19 -2 
   20 -3 
   21  2 
   22 -2 
   23  2 
   24 -0.3 
   25  0.3 
   26 -0.088388 
   27 eof
   28 
   29 sh ./test/runbas test.bas >test.data
   30 
   31 if cmp test.ref test.data
   32 then
   33   rm -f test.*
   34   echo passed
   35 else
   36   echo failed
   37   exit 1
   38 fi