https://github.com/jrincayc/ucblogo-code
Revision 8a2330fd79f92af13f3548510377dea4877e59c6 authored by Joshua J. Cogliati on 15 September 2019, 23:22:35 UTC, committed by Joshua J. Cogliati on 10 October 2019, 02:47:11 UTC
1 parent 7360ada
Tip revision: 8a2330fd79f92af13f3548510377dea4877e59c6 authored by Joshua J. Cogliati on 15 September 2019, 23:22:35 UTC
matherr is now deprecated.
matherr is now deprecated.
Tip revision: 8a2330f
UnitTests-Random.lg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; BERKELEY LOGO ;;
;; Random Number Unit Tests ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
InstallSuite [Random Numbers] [Tests.Random.Setup]
;; The list of all OOP unit tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MAKE "Tests.Random [
;list tests here
Tests.Random.RandomNumMonadic
Tests.Random.RandomNumDyadic
]
;; Test Suite setup procedure, main entry
;; point for all tests in this suite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to Tests.Random.Setup
RunTests :Tests.Random
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; HELPERS, MISC ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; ADD INDIVIDUAL UNIT TESTS BELOW ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;all tests must return T/F indicating success/failure
to Tests.Random.RandomNumMonadic
OUTPUT (AND [(Random 1) = 0])
end
to Tests.Random.RandomNumDyadic
Make "Num3 (Random 3 5)
print (AND [(Random -1 0) = -1]
[GreaterEqual? :num3 3]
[LessEqual? :num3 5])
end
Computing file changes ...