Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dan Holtby
uwaterloo-racket
Commits
1a142b2a
Commit
1a142b2a
authored
Oct 24, 2021
by
Dan Holtby
Browse files
add tests
parent
0e1e9abb
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdp-trace/info.rkt
View file @
1a142b2a
...
...
@@ -9,3 +9,6 @@
(
define
pkg-desc
"Wrapper for racket/trace that allows it to be used in Beginning Student (HtDP)"
)
(
define
version
"1.2"
)
(
define
pkg-authors
'
(
djholtby
))
(
define
test-include-paths
'
(
"tests/main
.
rkt"
))
(
define
test-omit-paths
'
(
"tests/bsl-test
.
rkt"
"tests/isl-test.rkt"
))
\ No newline at end of file
htdp-trace/tests/bsl-test.rkt
0 → 100755
View file @
1a142b2a
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#
reader
(
lib
"htdp-beginner-reader.ss"
"lang"
)((
modname
bsl-test
)
(
read-case-sensitive
#t
)
(
teachpacks
())
(
htdp-settings
#
(
#t
constructor
repeating-decimal
#f
#t
none
#f
()
#f
)))
(
require
"../main.rkt"
)
(
define/trace
(
f
lst
)
(
cond
[(
empty?
lst
)
0
]
[
else
(
+
(
first
lst
)
(
f
(
rest
lst
)))]))
(
f
(
list
1
2
3
))
htdp-trace/tests/isl-test.rkt
0 → 100755
View file @
1a142b2a
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#
reader
(
lib
"htdp-intermediate-lambda-reader.ss"
"lang"
)((
modname
isl-test
)
(
read-case-sensitive
#t
)
(
teachpacks
())
(
htdp-settings
#
(
#t
constructor
repeating-decimal
#f
#t
none
#f
()
#f
)))
(
require
"../main.rkt"
)
(
define/trace
(
f
lst
)
(
local
[(
define/trace
(
g
x
y
)
(
+
x
y
))]
(
cond
[(
empty?
lst
)
0
]
[
else
(
g
(
first
lst
)
(
f
(
rest
lst
)))])))
(
f
(
list
1
2
3
))
htdp-trace/tests/main.rkt
0 → 100755
View file @
1a142b2a
#
lang
racket/base
(
require
rackunit
)
(
define
bsl-output
(
open-output-string
))
(
parameterize
([
current-output-port
bsl-output
])
(
dynamic-require
"bsl-test.rkt"
#f
))
(
check-equal?
(
get-output-string
bsl-output
)
#
<<EXPECTED
>
(
f
'
(
1
2
3
))
>
(
f
'
(
2
3
))
>
>
(
f
'
(
3
))
>
>
(
f
'
())
<
<
0
<
<3
<
5
<6
6
EXPECTED
)
(
define
isl-output
(
open-output-string
))
(
parameterize
([
current-output-port
isl-output
])
(
dynamic-require
"isl-test.rkt"
#f
))
(
check-equal?
(
get-output-string
isl-output
)
#
<<EXPECTED
>
(
f
'
(
1
2
3
))
>
(
f
'
(
2
3
))
>
>
(
f
'
(
3
))
>
>
(
f
'
())
<
<
0
>
>
(
g
3
0
)
<
<3
>
(
g
2
3
)
<
5
>
(
g
1
5
)
<6
6
EXPECTED
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment