File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed
Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,27 @@ fn lint_cli_bindings() -> anyhow::Result<()> {
2929 Ok ( ( ) )
3030}
3131
32+ #[ test]
33+ fn lint_cli_p3_bindings ( ) -> anyhow:: Result < ( ) > {
34+ let dir = tempfile:: tempdir ( ) ?;
35+ fs_extra:: copy_items (
36+ & [ "./examples/cli-p3" , "./wit" ] ,
37+ dir. path ( ) ,
38+ & CopyOptions :: new ( ) ,
39+ ) ?;
40+ let path = dir. path ( ) . join ( "cli-p3" ) ;
41+
42+ generate_bindings ( & path, "wasi:cli/command@0.3.0-rc-2026-01-06" ) ?;
43+
44+ assert ! ( predicate:: path:: is_dir( ) . eval( & path. join( "wit_world" ) ) ) ;
45+
46+ _ = dir. keep ( ) ;
47+
48+ mypy_check ( & path, [ "--strict" , "-m" , "app" ] ) ;
49+
50+ Ok ( ( ) )
51+ }
52+
3253#[ test]
3354fn lint_http_bindings ( ) -> anyhow:: Result < ( ) > {
3455 let dir = tempfile:: tempdir ( ) ?;
Original file line number Diff line number Diff line change @@ -14,21 +14,30 @@ use tar::Archive;
1414
1515#[ test]
1616fn cli_example ( ) -> anyhow:: Result < ( ) > {
17+ test_cli_example ( "cli" , "wasi:cli/command@0.2.0" )
18+ }
19+
20+ #[ test]
21+ fn cli_p3_example ( ) -> anyhow:: Result < ( ) > {
22+ test_cli_example ( "cli-p3" , "wasi:cli/command@0.3.0-rc-2026-01-06" )
23+ }
24+
25+ fn test_cli_example ( name : & str , world : & str ) -> anyhow:: Result < ( ) > {
1726 let dir = tempfile:: tempdir ( ) ?;
1827 fs_extra:: copy_items (
19- & [ "./examples/cli" , "./wit" ] ,
28+ & [ format ! ( "./examples/{name}" ) . as_str ( ) , "./wit" ] ,
2029 dir. path ( ) ,
2130 & CopyOptions :: new ( ) ,
2231 ) ?;
23- let path = dir. path ( ) . join ( "cli" ) ;
32+ let path = dir. path ( ) . join ( name ) ;
2433
2534 cargo:: cargo_bin_cmd!( "componentize-py" )
2635 . current_dir ( & path)
2736 . args ( [
2837 "-d" ,
2938 "../wit" ,
3039 "-w" ,
31- "wasi:cli/command@0.2.0" ,
40+ world ,
3241 "componentize" ,
3342 "app" ,
3443 "-o" ,
@@ -40,7 +49,7 @@ fn cli_example() -> anyhow::Result<()> {
4049
4150 Command :: new ( "wasmtime" )
4251 . current_dir ( & path)
43- . args ( [ "run" , "cli.wasm" ] )
52+ . args ( [ "run" , "-Sp3" , "-Wcomponent-model-async" , " cli.wasm"] )
4453 . assert ( )
4554 . success ( )
4655 . stdout ( "Hello, world!\n " ) ;
You can’t perform that action at this time.
0 commit comments