This repository was archived by the owner on Jul 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ mod test {
7878 #[ cfg( target_os = "windows" ) ]
7979 const TEST2_MODULE_MAP_FILE : & str = "test2.toml" ;
8080 const TEST3_MODULE_MAP_FILE : & str = "test3.toml" ;
81+ const WAT_MODULE_MAP_FILE : & str = "wat.toml" ;
8182 const TEST_HEALTHZ_MODULE_MAP_FILE : & str = "test_healthz_override.toml" ;
8283 const TEST_DYNAMIC_ROUTES_MODULE_MAP_FILE : & str = "test_dynamic_routes.toml" ;
8384
@@ -341,6 +342,14 @@ mod test {
341342 }
342343 }
343344
345+ #[ tokio:: test]
346+ pub async fn can_serve_wat ( ) {
347+ let route = "/" ;
348+
349+ let response = get_plain_text_response_from_module_map ( WAT_MODULE_MAP_FILE , None , route) . await ;
350+ assert_eq ! ( "Oh hi world\r \n " , response) ;
351+ }
352+
344353 fn parse_ev_line ( line : & str ) -> Option < ( String , String ) > {
345354 line. find ( '=' ) . and_then ( |index| {
346355 let left = & line[ ..index] ;
Original file line number Diff line number Diff line change 1+ (module
2+ (import " wasi_snapshot_preview1" " fd_write" (func $fd_write (param i32 i32 i32 i32 ) (result i32 )))
3+ (memory 1 )
4+ (export " memory" (memory 0 ))
5+
6+ (data (i32.const 8 ) " content-type: text/plain\r\n \r\n Oh hi world\r\n " )
7+
8+ (func $main (export " _start" )
9+ (i32.store (i32.const 0 ) (i32.const 8 ))
10+ (i32.store (i32.const 4 ) (i32.const 41 ))
11+
12+ (call $fd_write
13+ (i32.const 1 )
14+ (i32.const 0 )
15+ (i32.const 1 )
16+ (i32.const 20 )
17+ )
18+ drop
19+ )
20+ )
Original file line number Diff line number Diff line change 1+ [[module ]]
2+ route = " /"
3+ module = " file:///${PROJECT_ROOT}/testdata/module-maps/crlf.wat"
You can’t perform that action at this time.
0 commit comments