cargo test will test examples that have a "main.rs", but in this case, the example requires manual compilation as a wasm module, and doesn't build as a standalone program. Rename it to "demo.rs".