https://github.com/jrincayc/ucblogo-code
Tip revision: 21ce9707d32d35f71bcba10c45742e8214881ea8 authored by Barak A. Pearlmutter on 13 January 2022, 14:54:59 UTC
update-alternatives instead of mere links for /usr/bin/logo
update-alternatives instead of mere links for /usr/bin/logo
Tip revision: 21ce970
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)
OUTPUT (AND [GreaterEqual? :num3 3]
[LessEqual? :num3 5])
end