22 lines
573 B
Racket
22 lines
573 B
Racket
#lang racket/base
|
|
|
|
(require rackunit
|
|
"../main.rkt"
|
|
"jsmaker-test-framework.rkt")
|
|
|
|
(provide list-tests)
|
|
|
|
(define list-tests
|
|
(test-suite
|
|
"list and quoted datum generation"
|
|
(test-case "list and cons"
|
|
(check-js-equal? (js (list 1 2 3)) "[1, 2, 3];\n")
|
|
(check-js-equal? (js (cons 1 (list 2 3))) "[1].concat([2, 3]);\n"))
|
|
(test-case "quoted data"
|
|
(check-js-equal? (js (quote alpha)) "\"alpha\";\n")
|
|
(check-js-equal? (js (quote (1 2 x))) "[1, 2, \"x\"];\n"))))
|
|
|
|
(module+ test
|
|
(require rackunit/text-ui)
|
|
(run-tests list-tests))
|