Skip to content

Instantly share code, notes, and snippets.

@fieldju
Created April 6, 2011 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fieldju/905287 to your computer and use it in GitHub Desktop.
Save fieldju/905287 to your computer and use it in GitHub Desktop.
;
; test script for programming assignment 1
; spring term, 2011
"Test Script"
"Values should be repeated, first your result, then correct result"
(map (lambda (x) (begin (display x) (newline)))
(list
(plusOne 42)
43
(plusOne 0)
1
(addToEnd 3 '(1 2))
'(1 2 3)
(addToEnd 3 '())
'(3)
(myReverse '(a b c))
'(c b a)
(myReverse '(a))
'(a)
(myReverse '())
'()
(myCount 3 '(1 2 3))
1
(countAll 3 '(1 3 (3 4) (3 4)))
3
(insert 2 '(1 3 5))
'(1 2 3 5)
(insert 0 '(1 3 5))
'(0 1 3 5)
(insert 6 '(1 3 5))
'(1 3 5 6)
(insert 3 '())
'(3)
(setAdd 3 '())
'(3)
(setAdd 3 '(1 2 4))
'(3 1 2 4)
(setAdd 3 '(1 2 3 4))
'(1 2 3 4)
(setIncludes 3 '(1 2 4))
#f
(setIncludes 3 '(1 2 3 4))
#t
(setIncludes 3 '())
#f
(setRemove 3 '(1 2 4))
'(1 2 4)
(setRemove 3 '(1 2 3 4))
'(1 2 4)
(setRemove 3 '())
'()
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment