From 7b49557a7e1e2239b6e7bc175fd5939fef431796 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sun, 20 Mar 2011 22:50:25 -0400 Subject: [PATCH] test cases are running again --- test-all.rkt | 4 ++-- test-conform-browser.rkt | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/test-all.rkt b/test-all.rkt index 7c05a40..206eb63 100644 --- a/test-all.rkt +++ b/test-all.rkt @@ -6,5 +6,5 @@ "test-assemble.rkt" "test-browser-evaluate.rkt" "test-package.rkt" - #;"test-conform.rkt" - #;"test-conform-browser.rkt") \ No newline at end of file + "test-conform-browser.rkt") +#;"test-conform.rkt" diff --git a/test-conform-browser.rkt b/test-conform-browser.rkt index d6dd95e..c10c20e 100644 --- a/test-conform-browser.rkt +++ b/test-conform-browser.rkt @@ -1,8 +1,36 @@ #lang racket (require "browser-evaluate.rkt" - "package.rkt") + "package.rkt" + racket/port + racket/runtime-path) -(define evaluate (make-evaluate package-anonymous)) +(define-runtime-path runtime.js "runtime.js") + +(define evaluate (make-evaluate + (lambda (program op) + + (fprintf op "(function () {") + + ;; The runtime code + (call-with-input-file* runtime.js + (lambda (ip) + (copy-port ip op))) + + (newline op) + + (fprintf op "var innerInvoke = ") + (package-anonymous program op) + (fprintf op "();\n") + + (fprintf op #<