MCPcopy Create free account
hub / github.com/arcjet/gravity / test_inline_wasm

Function test_inline_wasm

cmd/gravity/src/codegen/wasm.rs:65–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64 #[test]
65 fn test_inline_wasm() {
66 let var = GoIdentifier::private("wasm");
67 let wasm = WasmData::Inline(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
68 let mut tokens = Tokens::<Go>::new();
69 Wasm::new(&var, wasm).format_into(&mut tokens);
70 assert_eq!(
71 tokens.to_string().unwrap(),
72 r#"var wasm = []byte{
73 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
74}"#
75 );
76 }
77
78 #[test]
79 fn test_embedded_wasm() {

Callers

nothing calls this directly

Calls 1

format_intoMethod · 0.45

Tested by

no test coverage detected