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.
 
 
 
 
 
 

55 lines
1.6 KiB

  1. 1000 rem ------------------------------------------
  2. 1010 rem Filename: cvs1.bas
  3. 1020 rem Purpose: Verify CVS() and MKS$()
  4. 1100 rem ------------------------------------------
  5. 1120 A = 0.0001
  6. 1130 B$ = MKS$( A )
  7. 1140 C = CVS( B$ )
  8. 1150 R = A / C
  9. 1160 if R < 0.99 then goto TestFailed
  10. 1170 if R > 1.01 then goto TestFailed
  11. 1180 print "*** TEST #1 PASSED ***"
  12. 1200 rem ------------------------------------------
  13. 1220 A = -0.0001
  14. 1230 B$ = MKS$( A )
  15. 1240 C = CVS( B$ )
  16. 1250 R = A / C
  17. 1260 if R < 0.99 then goto TestFailed
  18. 1270 if R > 1.01 then goto TestFailed
  19. 1280 print "*** TEST #2 PASSED ***"
  20. 1300 rem ------------------------------------------
  21. 1320 A = 123456789
  22. 1330 B$ = MKS$( A )
  23. 1340 C = CVS( B$ )
  24. 1350 R = A / C
  25. 1360 if R < 0.99 then goto TestFailed
  26. 1370 if R > 1.01 then goto TestFailed
  27. 1380 print "*** TEST #3 PASSED ***"
  28. 1400 rem ------------------------------------------
  29. 1420 A = -123456789
  30. 1430 B$ = MKS$( A )
  31. 1440 C = CVS( B$ )
  32. 1450 R = A / C
  33. 1460 if R < 0.99 then goto TestFailed
  34. 1470 if R > 1.01 then goto TestFailed
  35. 1480 print "*** TEST #4 PASSED ***"
  36. 1500 rem ------------------------------------------
  37. 1520 A = 0
  38. 1530 B$ = MKS$( A )
  39. 1540 C = CVS( B$ )
  40. 1570 if C <> 0 then goto TestFailed
  41. 1580 print "*** TEST #5 PASSED ***"
  42. 8000 rem ------------------------------------------
  43. 8010 TestPassed:
  44. 8020 print "*** ALL TESTS PASSED ***"
  45. 8030 goto TheEnd
  46. 8500 rem ------------------------------------------
  47. 8510 TestFailed:
  48. 8520 print "*** TEST FAILED ***"
  49. 8522 print "A="; A
  50. 8524 print "C="; C
  51. 8530 goto TheEnd
  52. 9000 rem ------------------------------------------
  53. 9010 TheEnd:
  54. 9999 end