Clean up wasm store construction, avoid hard-coding initial memory size

Retrieve the initial memory size from the stdlib's memory import type.
This commit is contained in:
Max Brunsfeld 2024-03-14 18:11:43 -07:00
parent 7a9b3076ef
commit fed9b98d6c
2 changed files with 121 additions and 101 deletions

View file

@ -115,6 +115,9 @@ fn test_load_multiple_wasm_languages() {
.unwrap();
let mut query_cursor = QueryCursor::new();
// First, parse with the store that originally loaded the languages.
// Then parse with a new parser and wasm store, so that the languages
// are added one-by-one, in between parses.
for mut parser in [parser, parser2] {
for _ in 0..2 {
let query_rust = Query::new(&language_rust, "(const_item) @foo").unwrap();