ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

160 lines
4.7 KiB

  1. REM ------------------------------------------------------------
  2. REM PURPOSE: TEST THE PARAMETER RANGE CHECKS
  3. REM AUTHOR: HOWARD WULF, AF5NE
  4. REM GENERATED: 02/21/2015 14:08:27
  5. REM FILENAME: F_LTRIM_A_S.BAS
  6. REM SYNTAX: S$ = LTRIM$( A$ )
  7. REM UNIQUEID: F_LTRIM_A_S
  8. REM FUNCTION: LTRIM$
  9. REM
  10. REM VARIABLE DESCRIPTION
  11. REM I CURRENT TESTCASE NUMBER
  12. REM E EXPECTED ERROR FLAG
  13. REM F ACTUAL ERROR FLAG
  14. REM R$ EXPECTED FUNCTION RESULT
  15. REM S$ ACTUAL FUNCTION RESULT
  16. REM A$ ACTUAL FUNCTION PARAMETER
  17. REM
  18. RESTORE 2000
  19. REM GET TESTCASE #
  20. READ I
  21. WHILE I > 0
  22. REM GET TESTCASE DATA
  23. READ E, R$, A$
  24. REM DISPLAY TESTCASE DATA
  25. PRINT "TESTCASE #";I,"E=";E,"R$=[";R$;"]", "A$=[";A$;"]"
  26. REM EXECUTE TESTCASE
  27. N = 0
  28. S$ = ""
  29. ON ERROR GOTO 9000
  30. F = 0
  31. 999 S$ = LTRIM$( A$ )
  32. ERROR 0
  33. REM DISPLAY TESTCASE RESULTS
  34. PRINT ,"F=";F,"S$=[";S$;"]"
  35. REM VERIFY EXPECTED ERROR
  36. IF E <> F THEN
  37. PRINT "*** TEST FAILED, EXCEPTION MISMATCH ***"
  38. STOP
  39. END IF
  40. REM VERIFY EXPECTED RESULT
  41. IF R$ <> S$ THEN
  42. PRINT "*** TEST FAILED, RESULT MISMATCH ***"
  43. STOP
  44. END IF
  45. PRINT "*** TEST PASSED ***"
  46. REM GET NEXT TESTCASE #
  47. READ I
  48. WEND
  49. PRINT "*** ALL TESTS PASSED ***"
  50. GOTO 9999
  51. 1999 REM TESTCASE, EXPECTED ERROR, EXPECTED RESULT, PARAMETERS...
  52. DATA 1 , 0 , "", ""
  53. DATA 2 , 0 , "", " "
  54. DATA 3 , 0 , "3", "3"
  55. DATA 4 , 0 , "z", "z"
  56. DATA 5 , 0 , "", " "
  57. DATA 6 , 0 , "3", " 3"
  58. DATA 7 , 0 , "z", " z"
  59. DATA 8 , 0 , "3 ", "3 "
  60. DATA 9 , 0 , "z ", "z "
  61. DATA 10 , 0 , "3 ", " 3 "
  62. DATA 11 , 0 , "z ", " z "
  63. DATA 12 , 0 , "LLLL", " LLLL"
  64. DATA 13 , 0 , "'' ", " '' "
  65. DATA 14 , 0 , "oo ", " oo "
  66. DATA 15 , 0 , "00 ", " 00 "
  67. DATA 16 , 0 , "\\\\ ", " \\\\ "
  68. DATA 17 , 0 , "lllll ", " lllll "
  69. DATA 18 , 0 , "uuuu ", " uuuu "
  70. DATA 19 , 0 , "a ", " a "
  71. DATA 20 , 0 , "", " "
  72. DATA 21 , 0 , "hh ", " hh "
  73. DATA 22 , 0 , "h ", " h "
  74. DATA 23 , 0 , ")", " )"
  75. DATA 24 , 0 , "5 ", " 5 "
  76. DATA 25 , 0 , "2 ", " 2 "
  77. DATA 26 , 0 , "- ", " - "
  78. DATA 27 , 0 , "dd ", "dd "
  79. DATA 28 , 0 , "tttt ", " tttt "
  80. DATA 29 , 0 , ":::: ", " :::: "
  81. DATA 30 , 0 , "___ ", " ___ "
  82. DATA 31 , 0 , "", " "
  83. DATA 32 , 0 , "", " "
  84. DATA 33 , 0 , "_____ ", " _____ "
  85. DATA 34 , 0 , "S ", " S "
  86. DATA 35 , 0 , "FFFF ", " FFFF "
  87. DATA 36 , 0 , "kkk", " kkk"
  88. DATA 37 , 0 , "NNNN ", " NNNN "
  89. DATA 38 , 0 , "mmmm ", " mmmm "
  90. DATA 39 , 0 , ",,,,, ", " ,,,,, "
  91. DATA 40 , 0 , "OO ", "OO "
  92. DATA 41 , 0 , "HHHH ", " HHHH "
  93. DATA 42 , 0 , "< ", " < "
  94. DATA 43 , 0 , "j ", " j "
  95. DATA 44 , 0 , "yyyy ", " yyyy "
  96. DATA 45 , 0 , "+++ ", " +++ "
  97. DATA 46 , 0 , "o ", "o "
  98. DATA 47 , 0 , "((", " (("
  99. DATA 48 , 0 , "uu ", " uu "
  100. DATA 49 , 0 , "00 ", " 00 "
  101. DATA 50 , 0 , "HH ", " HH "
  102. DATA 51 , 0 , "", " "
  103. DATA 52 , 0 , "G ", " G "
  104. DATA 53 , 0 , "{{{{ ", " {{{{ "
  105. DATA 54 , 0 , "]]] ", " ]]] "
  106. DATA 55 , 0 , "CCC", "CCC"
  107. DATA 56 , 0 , "44 ", " 44 "
  108. DATA 57 , 0 , "^^ ", "^^ "
  109. DATA 58 , 0 , "QQ ", " QQ "
  110. DATA 59 , 0 , "FFFF ", " FFFF "
  111. DATA 60 , 0 , "n ", " n "
  112. DATA 61 , 0 , "hh ", " hh "
  113. DATA 62 , 0 , "555 ", "555 "
  114. DATA 63 , 0 , "YYYY ", " YYYY "
  115. DATA 64 , 0 , "w ", " w "
  116. DATA 65 , 0 , "MMMM ", "MMMM "
  117. DATA 66 , 0 , "JJJJ ", " JJJJ "
  118. DATA 67 , 0 , "%% ", " %% "
  119. DATA 68 , 0 , "* ", " * "
  120. DATA 69 , 0 , "@@@ ", " @@@ "
  121. DATA 70 , 0 , "I ", "I "
  122. DATA 71 , 0 , "ss ", " ss "
  123. DATA 72 , 0 , "f ", " f "
  124. DATA 73 , 0 , "D ", " D "
  125. DATA 74 , 0 , "### ", "### "
  126. DATA 75 , 0 , "' ", " ' "
  127. DATA 76 , 0 , "dd ", " dd "
  128. DATA 77 , 0 , "TT ", " TT "
  129. DATA 78 , 0 , "vvv ", " vvv "
  130. DATA 79 , 0 , "X ", " X "
  131. DATA 80 , 0 , "% ", " % "
  132. DATA 81 , 0 , "", " "
  133. DATA 82 , 0 , "5555 ", " 5555 "
  134. DATA 83 , 0 , "FFFF ", "FFFF "
  135. DATA 84 , 0 , "%% ", " %% "
  136. DATA 85 , 0 , "", " "
  137. DATA 86 , 0 , "~~~~ ", " ~~~~ "
  138. DATA 87 , 0 , "|| ", " || "
  139. DATA 88 , 0 , "SSS ", " SSS "
  140. DATA 89 , 0 , "6666 ", " 6666 "
  141. DATA 90 , 0 , "ww ", " ww "
  142. DATA 91 , 0 , "1111 ", " 1111 "
  143. DATA 92 , 0 , "K ", " K "
  144. DATA 93 , 0 , "ttttt ", " ttttt "
  145. DATA 94 , 0 , "OOOOO ", " OOOOO "
  146. DATA 95 , 0 , "E ", " E "
  147. DATA 96 , 0 , "PPPPP ", " PPPPP "
  148. DATA 97 , 0 , "== ", " == "
  149. DATA 98 , 0 , "VVVV ", " VVVV "
  150. DATA 99 , 0 , "c ", " c "
  151. DATA 100 , 0 , "yyyy ", " yyyy "
  152. DATA 0
  153. 9000 REM ERROR HANDLER
  154. IF ERL = 999 THEN
  155. F = ABS(SGN(ERR))
  156. RESUME NEXT
  157. END IF
  158. PRINT "*** UNEXPECTED ERROR ON LINE ";ERL;" ***"
  159. 9999 END