Skip to content

Commit

Permalink
add test case for sicp example
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwparas committed Dec 7, 2023
1 parent 0bc1db6 commit 8402e0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/steel-core/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ test_harness_success! {
set_local,
set_tail_call,
shift_reset,
sicp_example,
sieve,
simple_stream_with_map,
simple_stream_with_mapping,
Expand Down
6 changes: 6 additions & 0 deletions crates/steel-core/src/tests/success/sicp_example.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define (a-plus-abs-b a b)
((if (> b 0) + -) a b))

;; 3
(assert! (equal? 3 (a-plus-abs-b 1 2)))
(assert! (equal? 3 (a-plus-abs-b 1 -2)))

0 comments on commit 8402e0e

Please sign in to comment.