Is there a test suite for the JavaScript runtime?
Tests for FFI stuff is in this directory: https://github.com/racketscript/racketscript/tree/master/tests/ffi
Okay - I have an issue with the integration tests in which when I run something like ./fixture.rkt -o -v racket-core/hash.rkt
it will freeze on the Node portion of the tests.
I can build racket-core/hash.rkt
fine with racks
and output it with node.
will look at the ffi tests - would like to make sure this symbol class i’m working on is tested in JS
I will try running that test on my machine and see hopefully I can be useful in debugging this.
Meanwhile, the unit tests are broken, but those look straightforward to fix.
Some observations on using racks
when I compile a simple racket file (ex:
racks --target webpack test.rkt
), it createsjs-build
but notdist
file. The output JS is inmodules
.when I cd into
js-build
and runnpx webpack
there are some module resolution errors:
ERROR in ./collects/racket/list.rkt.js 1:80531-80545
export 'bitwise_xor' (imported as 'M6') was not found in '../../runtime/kernel.rkt.js' ...
It looks like a missing primitive function.
bitwise_xor
and bitwise_and
We have not implemented all the kernel primitives. The way to fix that would be add bitwise-or
and bitwise-and
in kernel.rkt file.
this is test.rkt
#lang racket
(displayln (symbol? 'foo))
(displayln (list-update '(zero one two) 0 symbol->string))
(displayln (list-update '(zero one two) 1 symbol->string))
ah ok
You’ll need to use FFI for kernel.rkt. Here is an example of using native JS operators: https://github.com/racketscript/racketscript/blob/master/racketscript-compiler/racketscript/compiler/runtime/kernel.rkt#L66
:+1: will start a new branch