Files
gemigreerd-js-maker/testing/jsmaker-list-regression.rkt
2026-06-08 13:21:57 +02:00

20 lines
544 B
Racket

#lang racket/base
(require "../main.rkt"
"jsmaker-test-framework.rkt")
(define list-program
(string-append
(js (define (makeList) (return (list 1 2 3))))
"\nconsole.log(JSON.stringify(makeList()));\n"))
(run-js-if-available 'list-runtime list-program "[1,2,3]")
(define cons-program
(string-append
(js (define (prepend xs) (return (cons 1 xs))))
"\nconsole.log(JSON.stringify(prepend([2,3])));\n"))
(run-js-if-available 'cons-runtime cons-program "[1,2,3]")
(module+ main
(test-summary 'jsmaker-list-regression))