"Fossies" - the Fresh Open Source Software Archive

Member "bas-2.6/test/test54" (2 Jul 2019, 724 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: 'UNNUM... '
    4 
    5 cat >test.bas <<'eof'
    6 100 for i=1 to 10
    7 130 gosub 180 
    8 131 next
    9 132 goto 200
   10 180 print "foo"
   11 190 return
   12 200 k=1
   13 210 restore 300
   14 220 read a,b,c
   15 230 print using 400;a,b,c
   16 240 k=k+1:if k<5 then goto 210
   17 250 end
   18 300 data 1,2,3
   19 400 image "## ## ##"
   20 eof
   21 
   22 cat >test.input <<'eof'
   23 load "test.bas"
   24 unnum
   25 save "test.bas"
   26 eof
   27 cat >test.ref <<'eof'
   28     for i=1 to 10
   29       gosub 180
   30     next
   31     goto 200
   32 180 print "foo"
   33     return
   34 200 k=1
   35 210 restore 300
   36     read a,b,c
   37     print using 400;a,b,c
   38     k=k+1 : if k<5 then goto 210
   39     end
   40 300 data 1,2,3
   41 400 image "## ## ##"
   42 eof
   43 
   44 sh ./test/runbas <test.input
   45 
   46 if cmp test.ref test.bas
   47 then
   48   rm -f test.*
   49   echo passed
   50 else
   51   echo failed
   52   exit 1
   53 fi
   54