diff --git a/lang/kernel.rkt b/lang/kernel.rkt index 82d1457..6e8c8ef 100644 --- a/lang/kernel.rkt +++ b/lang/kernel.rkt @@ -396,7 +396,7 @@ ;; call-with-current-continuation -;; call/cc + call/cc ;; call-with-continuation-prompt ;; abort-current-continuation ;; default-continuation-prompt-tag diff --git a/tests/browser-harness.rkt b/tests/browser-harness.rkt index 6e09168..87fd5e1 100644 --- a/tests/browser-harness.rkt +++ b/tests/browser-harness.rkt @@ -63,6 +63,14 @@ EOF (define-syntax (test stx) (syntax-case stx () + [(_ original-source-file-path) + (with-syntax ([expected-file-path + (regexp-replace "\\.rkt$" + (syntax-e + #'original-source-file-path) + ".expected")]) + + #'(test original-source-file-path expected-file-path))] [(_ original-source-file-path expected-file-path) (with-syntax ([stx stx] [source-file-path (parameterize ([current-directory diff --git a/tests/more-tests/run-more-tests.rkt b/tests/more-tests/run-more-tests.rkt index b8a92d5..e347551 100644 --- a/tests/more-tests/run-more-tests.rkt +++ b/tests/more-tests/run-more-tests.rkt @@ -2,5 +2,10 @@ (require "../browser-harness.rkt") -(test "hello.rkt" "hello.expected") -#;(test "simple-structs.rkt" "simple-structs.expected") \ No newline at end of file +;; Each of the tests below do a string-compare of the standard output +;; content vs. a text file with the same name, but with the .rkt file +;; type replaced with .expected. + +(test "hello.rkt") +(test "sk-generator.rkt") +#;(test "simple-structs.rkt") \ No newline at end of file diff --git a/tests/more-tests/sk-generator.expected b/tests/more-tests/sk-generator.expected new file mode 100644 index 0000000..9df02fe --- /dev/null +++ b/tests/more-tests/sk-generator.expected @@ -0,0 +1,3 @@ +"a" +"b" +"c" diff --git a/tests/more-tests/sk-generator.rkt b/tests/more-tests/sk-generator.rkt new file mode 100644 index 0000000..be97451 --- /dev/null +++ b/tests/more-tests/sk-generator.rkt @@ -0,0 +1,22 @@ +#lang planet dyoo/whalesong +(define (make-gen gen) + (let ([cont #f]) + (lambda () + (call/cc (lambda (caller) + (if cont + (cont caller) + (gen (lambda (v) + (call/cc (lambda (gen-k) + (begin + (set! cont gen-k) + (caller v)))))))))))) + +(define g1 (make-gen (lambda (return) + (begin + (return "a") + (return "b") + (return "c"))))) + +(g1) +(g1) +(g1)