moonbitlang/core

Inspect may make the test driver crash

CAIMEOX opened this issue · 1 comments

The following code will break the test driver

test "inspect" {
  inspect!("\x00")
}

which outputs:

failed: parse expect test result failed: {"loc": "/Users/caimeo/code/quickcheck/qc/qc_demo.mbt:209:3-209:19", "args_loc": "[\"/Users/caimeo/code/quickcheck/qc/qc_demo.mbt:209:12-209:18\", null, null, null]", "expect": "", "actual": "\x00"}

Caused by:
    invalid escape at line 1 column 194

This is because {"actual": "\x00"} is not a valid JSON. We need to fix "\x00".escape() or add a new escape method.