wasm2map
wasm2map copied to clipboard
Come up with a test case for the sourcemap generation code (WASM::map_v3)
Background
Testing the valid sourcemap generation capabilities of the library can't be easily accomplished. Since this library translates DWARF code, in order to test it we need to inspect both the sourcemap and the DWARF code, which basically means a complete reimplementation of this lib (which in turn is quite pointless).
The obvious solution would be to run another tool on the same WASM file and compare the results. For this purpose the original inspiration, Emscripten's wasm_sourcemap.py
can be run via an external python interpreter in the test. The downside is that it requires the test runner to have python installed.
Success
Total code coverage on the sourcemap generation code in the lib (i.e. WASM::load(), WASM::map_v3(), WASM::generate(),WASM::encode_vlq)