"Fossies" - the Fresh Open Source Software Archive

Member "bas-2.6/test/test56" (2 Jul 2019, 487 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.

    1 #!/bin/sh
    2 
    3 echo -n $0: 'FOR STEP evaluation... '
    4 
    5 cat >test.bas <<'eof'
    6 10 let I1=-3
    7 20 let K=1
    8 30 for I1=I1 to -20 step I1
    9 40   print K,I1
   10 50   let K=K+1
   11 60 next I1
   12 70 print "AFTER: ",I1
   13 80 end
   14 eof
   15 
   16 cat >test.ref <<'eof'
   17  1            -3 
   18  2            -6 
   19  3            -9 
   20  4            -12 
   21  5            -15 
   22  6            -18 
   23 AFTER:        -21 
   24 eof
   25 
   26 sh ./test/runbas test.bas >test.data
   27 
   28 if cmp test.ref test.data
   29 then
   30   rm -f test.*
   31   echo passed
   32 else
   33   echo failed
   34   exit 1
   35 fi
   36