diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6439acf27..f00022a70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: uses: actions/cache@v4 with: path: tests/gen - key: wasi-${{ hashFiles('xtask/src/generate/tests.rs', 'submodules/wasmtime/Cargo.lock') }} + key: wasi-${{ hashFiles('xtask/src/generate/preview2_tests.rs', 'submodules/wasmtime/Cargo.lock') }} - name: Install Rust if: steps.cache-wasi-tests.outputs.cache-hit != 'true' run: rustup update stable --no-self-update && rustup default stable @@ -157,6 +157,7 @@ jobs: node: 20.x - os: windows-latest node: 18.x + fail-fast: false runs-on: ${{ matrix.os }} needs: [build, build-wasi-tests] steps: diff --git a/Cargo.lock b/Cargo.lock index 3e18106ec..de07276ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "atty" @@ -93,9 +93,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "cranelift-bitset" -version = "0.112.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2797648025a7b2e32ec49fb2f71655fed74453cd41e209c6e39fd3107654f8" +checksum = "8ab25ef3be935a80680e393183e1f94ef507e93a24a8369494d2c6818aedb3e3" dependencies = [ "serde", "serde_derive", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "cranelift-entity" -version = "0.112.0" +version = "0.113.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e9d6c799b0775d43211d983b5f9230ea604063003cb6d492daf8dcac51da9b" +checksum = "e2d770e6605eccee15b49decdd82cd26f2b6404767802471459ea49c57379a98" dependencies = [ "cranelift-bitset", "serde", @@ -151,11 +151,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "indexmap", ] @@ -170,6 +176,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "foldhash", +] + [[package]] name = "heck" version = "0.3.3" @@ -202,12 +217,12 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.0", "serde", ] @@ -242,8 +257,8 @@ dependencies = [ "heck 0.5.0", "log", "semver", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.218.0", + "wasmparser 0.218.0", "wasmtime-environ", "wit-bindgen-core", "wit-component", @@ -275,9 +290,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "log" @@ -303,21 +318,21 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "crc32fast", - "hashbrown", + "hashbrown 0.15.0", "indexmap", "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "postcard" @@ -343,12 +358,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.85", ] [[package]] @@ -377,9 +392,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -410,29 +425,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -501,9 +516,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -572,19 +587,29 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasm-encoder" -version = "0.217.0" +version = "0.218.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b896fa8ceb71091ace9bcb81e853f54043183a1c9667cf93422c40252ffa0a" +dependencies = [ + "leb128", + "wasmparser 0.218.0", +] + +[[package]] +name = "wasm-encoder" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" +checksum = "29cbbd772edcb8e7d524a82ee8cef8dd046fc14033796a754c3ad246d019fa54" dependencies = [ "leb128", - "wasmparser", + "wasmparser 0.219.1", ] [[package]] name = "wasm-metadata" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a146bf9a60e9264f0548a2599aa9656dba9a641eff9ab88299dc2a637e483c" +checksum = "aa5eeb071abe8a2132fdd5565dabffee70775ee8c24fc7e300ac43f51f4a8a91" dependencies = [ "anyhow", "indexmap", @@ -592,8 +617,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.218.0", + "wasmparser 0.218.0", ] [[package]] @@ -601,9 +626,9 @@ name = "wasm-tools-js" version = "0.1.0" dependencies = [ "anyhow", - "wasm-encoder", + "wasm-encoder 0.218.0", "wasm-metadata", - "wasmparser", + "wasmparser 0.218.0", "wasmprinter", "wat", "wit-bindgen", @@ -613,40 +638,50 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7" +checksum = "b09e46c7fceceaa72b2dd1a8a137ea7fd8f93dfaa69806010a709918e496c5dc" dependencies = [ "ahash", "bitflags 2.6.0", - "hashbrown", + "hashbrown 0.14.5", "indexmap", "semver", "serde", ] +[[package]] +name = "wasmparser" +version = "0.219.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c771866898879073c53b565a6c7b49953795159836714ac56a5befb581227c5" +dependencies = [ + "bitflags 2.6.0", + "indexmap", +] + [[package]] name = "wasmprinter" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dc568b3e0d47e8f96ea547c90790cfa783f0205160c40de894a427114185ce" +checksum = "0ace089155491837b75f474bf47c99073246d1b737393fe722d6dee311595ddc" dependencies = [ "anyhow", "termcolor", - "wasmparser", + "wasmparser 0.218.0", ] [[package]] name = "wasmtime-component-util" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8553d3720625ad4e65a9c71e215566361fcefc4e4001f17e7c669c503c33e6f6" +checksum = "cfe3c27d64af5f584014db9381c081223d27a57e1dce2f6280bbafea37575619" [[package]] name = "wasmtime-environ" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe742ef5ee9ce201e513ee8da472eaf198e760499a730853622fc85a61cfb1eb" +checksum = "f3444c1759d5b906ff76a3cab073dd92135bdd06e5d1f46635ec40a58207d314" dependencies = [ "anyhow", "cranelift-bitset", @@ -659,46 +694,32 @@ dependencies = [ "semver", "serde", "serde_derive", + "smallvec", "target-lexicon", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.218.0", + "wasmparser 0.218.0", "wasmprinter", "wasmtime-component-util", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-types" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24adc06abbf23bf9abbdc4b4a3bb743436a60a2a76dfabb2e49bf5237d0dadcc" -dependencies = [ - "anyhow", - "cranelift-entity", - "serde", - "serde_derive", - "smallvec", - "wasmparser", ] [[package]] name = "wast" -version = "217.0.0" +version = "219.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7" +checksum = "4f79a9d9df79986a68689a6b40bcc8d5d40d807487b235bebc2ac69a242b54a1" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder", + "wasm-encoder 0.219.1", ] [[package]] name = "wat" -version = "1.217.0" +version = "1.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088" +checksum = "8bc3cf014fb336883a411cd662f987abf6a1d2a27f2f0008616a0070bbf6bd0d" dependencies = [ "wast", ] @@ -830,9 +851,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "wit-bindgen" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb9327b2afd6af02ab39f8fbde6bfc7d369d14bc8c8688311d3defcda3952bd" +checksum = "8fcf26778671a2327bd237a32c6f2d1d9bb0ec077e482b0839552b00d4566544" dependencies = [ "wit-bindgen-rt", "wit-bindgen-rust-macro", @@ -840,9 +861,9 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc9cfd3f1b4e29e9a90fe04157764f24ae396cfb8530dae5753de140e73f9e56" +checksum = "4b885a00e1c428fd12b7b7c4bccc4bad8b2a3ca0abe8eaf1e0f90adabb4c7ac7" dependencies = [ "anyhow", "heck 0.5.0", @@ -851,24 +872,24 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca6f307148acf7199e492fd3781cc7b79f8f3eda003c0ac3aa8079449601ccb" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "wit-bindgen-rust" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf075ae0c89dc391f7d710d70c69bfd018c029c74a54f7ddfd0266dccc8ff0c5" +checksum = "542608877814a54f6bea6b24dcbe249a2e293d67d709f4f8ec578d06b1c00730" dependencies = [ "anyhow", "heck 0.5.0", "indexmap", "prettyplease", - "syn 2.0.77", + "syn 2.0.85", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -876,24 +897,24 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ab28d36e4d326bd43d483512348874d4fffa378d8dc1da6dd6521afe2ec4f6" +checksum = "30d462025f670fff96606ddbfe62500255b4fe3de7298cd9cbabb2de3d567183" dependencies = [ "anyhow", "prettyplease", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.85", "wit-bindgen-core", "wit-bindgen-rust", ] [[package]] name = "wit-component" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7117809905e49db716d81e794f79590c052bf2fdbbcda1731ca0fb28f6f3ddf" +checksum = "aa53aa7e6bf2b3e8ccaffbcc963fbdb672a603dc0af393a481b6cec24c266406" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -902,9 +923,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder", + "wasm-encoder 0.218.0", "wasm-metadata", - "wasmparser", + "wasmparser 0.218.0", "wat", "wit-parser", ] @@ -922,9 +943,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb893dcd6d370cfdf19a0d9adfcd403efb8e544e1a0ea3a8b81a21fe392eaa78" +checksum = "0d3d1066ab761b115f97fef2b191090faabcb0f37b555b758d3caf42d4ed9e55" dependencies = [ "anyhow", "id-arena", @@ -935,7 +956,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser", + "wasmparser 0.218.0", ] [[package]] @@ -991,5 +1012,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index 2210766d7..127dc4895 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,26 +34,26 @@ rpath = false strip = true [workspace.dependencies] -anyhow = "1.0.89" +anyhow = "1.0.91" base64 = "0.22.1" heck = "0.5.0" log = "0.4.22" semver = "1.0.23" js-component-bindgen = { path = "./crates/js-component-bindgen" } structopt = "0.3.26" -wasm-encoder = "0.217.0" -wasm-metadata = "0.217.0" -wasmparser = "0.217.0" -wasmprinter = "0.217.0" -wasmtime-environ = { version = "25.0.0", features = [ +wasm-encoder = "0.218.0" +wasm-metadata = "0.218.0" +wasmparser = "0.218.0" +wasmprinter = "0.218.0" +wasmtime-environ = { version = "26.0.0", features = [ "component-model", "compile", ] } -wat = "1.217.0" -wit-bindgen = "0.32.0" -wit-bindgen-core = "0.32.0" -wit-component = { version = "0.217.0", features = ["dummy-module"] } -wit-parser = "0.217.0" +wat = "1.218.0" +wit-bindgen = "0.33.0" +wit-bindgen-core = "0.33.0" +wit-component = { version = "0.218.0", features = ["dummy-module"] } +wit-parser = "0.218.0" xshell = "0.2.6" [dev-dependencies] diff --git a/crates/js-component-bindgen/src/core.rs b/crates/js-component-bindgen/src/core.rs index e02949a0b..b01583830 100644 --- a/crates/js-component-bindgen/src/core.rs +++ b/crates/js-component-bindgen/src/core.rs @@ -42,8 +42,7 @@ use wasm_encoder::*; use wasmparser::collections::IndexMap; use wasmparser::*; use wasmtime_environ::component::CoreDef; -use wasmtime_environ::{wasmparser, ModuleTranslation}; -use wasmtime_environ::{EntityIndex, MemoryIndex, PrimaryMap}; +use wasmtime_environ::{EntityIndex, MemoryIndex, ModuleTranslation, PrimaryMap}; fn unimplemented_try_table() -> wasm_encoder::Instruction<'static> { unimplemented!() @@ -345,7 +344,7 @@ impl Augmenter<'_> { // before. let mut types = TypeSection::new(); for ty in &self.types { - types.function( + types.ty().function( ty.params().iter().map(|v| valtype(*v)), ty.results().iter().map(|v| valtype(*v)), ); @@ -479,7 +478,7 @@ fn valtype(ty: wasmparser::ValType) -> wasm_encoder::ValType { struct CollectMemOps<'a, 'b>(&'a mut Augmenter<'b>); macro_rules! define_visit { - ($(@$p:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => { + ($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident ($($ann:tt)*))*) => { $( #[allow(unreachable_code)] fn $visit(&mut self $( $( ,$arg: $argty)* )?) { @@ -569,35 +568,35 @@ impl AugmentedOp { | AugmentedOp::I32Load8S | AugmentedOp::I32Load16U | AugmentedOp::I32Load16S => { - section.function([I32, I32], [I32]); + section.ty().function([I32, I32], [I32]); } AugmentedOp::I64Load => { - section.function([I32, I32], [I64]); + section.ty().function([I32, I32], [I64]); } AugmentedOp::F32Load => { - section.function([I32, I32], [F32]); + section.ty().function([I32, I32], [F32]); } AugmentedOp::F64Load => { - section.function([I32, I32], [F64]); + section.ty().function([I32, I32], [F64]); } // Stores, like loads, take an additional argument than usual which // is the static offset on the store instruction. AugmentedOp::I32Store | AugmentedOp::I32Store8 | AugmentedOp::I32Store16 => { - section.function([I32, I32, I32], []); + section.ty().function([I32, I32, I32], []); } AugmentedOp::I64Store => { - section.function([I32, I64, I32], []); + section.ty().function([I32, I64, I32], []); } AugmentedOp::F32Store => { - section.function([I32, F32, I32], []); + section.ty().function([I32, F32, I32], []); } AugmentedOp::F64Store => { - section.function([I32, F64, I32], []); + section.ty().function([I32, F64, I32], []); } AugmentedOp::MemorySize => { - section.function([], [I32]); + section.ty().function([], [I32]); } } } @@ -614,8 +613,9 @@ macro_rules! define_translate { // This is the base case where all methods are defined and the body of each // method delegates to a recursive invocation of this macro to hit one of // the cases below. - ($(@$p:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => { + ($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident ($($ann:tt)*))*) => { $( + #[allow(unreachable_code)] #[allow(dropping_copy_types)] fn $visit(&mut self $(, $($arg: $argty),*)?) { #[allow(unused_imports)] @@ -768,6 +768,12 @@ macro_rules! define_translate { (map $self:ident $arg:ident array_type_index_src) => ($self.remap(Item::Type, $arg).unwrap()); (map $self:ident $arg:ident from_ref_type) => ($self.refty(&$arg).unwrap()); (map $self:ident $arg:ident to_ref_type) => ($self.refty(&$arg).unwrap()); + (map $self:ident $arg:ident cont_type_index) => ($self.remap(Item::Type, $arg).unwrap()); + (map $self:ident $arg:ident argument_index) => ($self.remap(Item::Type, $arg).unwrap()); + (map $self:ident $arg:ident result_index) => ($self.remap(Item::Type, $arg).unwrap()); + (map $self:ident $arg:ident resume_table) => (( + unimplemented!() + )); } impl<'a> VisitOperator<'a> for Translator<'_, 'a> { diff --git a/crates/js-component-bindgen/src/intrinsics.rs b/crates/js-component-bindgen/src/intrinsics.rs index 5899bd739..413c6da9d 100644 --- a/crates/js-component-bindgen/src/intrinsics.rs +++ b/crates/js-component-bindgen/src/intrinsics.rs @@ -176,7 +176,7 @@ pub fn render_intrinsics( let _fs; async function fetchCompile (url) { if (isNode) { - _fs = _fs || await import('fs/promises'); + _fs = _fs || await import('node:fs/promises'); return WebAssembly.compile(await _fs.readFile(url)); } return fetch(url).then(WebAssembly.compileStreaming); diff --git a/crates/js-component-bindgen/src/lib.rs b/crates/js-component-bindgen/src/lib.rs index 0d3c71d37..e41198208 100644 --- a/crates/js-component-bindgen/src/lib.rs +++ b/crates/js-component-bindgen/src/lib.rs @@ -15,7 +15,6 @@ use transpile_bindgen::transpile_bindgen; use anyhow::{bail, ensure, Context}; use wasmtime_environ::component::{ComponentTypesBuilder, Export, StaticModuleIndex}; -use wasmtime_environ::wasmparser::Validator; use wasmtime_environ::{PrimaryMap, ScopeVec, Tunables}; use wit_component::DecodedWasm; @@ -81,6 +80,7 @@ pub fn generate_types( /// Outputs the file map and import and export metadata for the Transpilation #[cfg(feature = "transpile-bindgen")] pub fn transpile(component: &[u8], opts: TranspileOpts) -> Result { + use wasmparser::Validator; use wasmtime_environ::component::{Component, Translator}; let name = opts.name.clone(); diff --git a/lib/wasi_snapshot_preview1.command.wasm b/lib/wasi_snapshot_preview1.command.wasm index cb1b64d12..61cb60a1c 100644 Binary files a/lib/wasi_snapshot_preview1.command.wasm and b/lib/wasi_snapshot_preview1.command.wasm differ diff --git a/lib/wasi_snapshot_preview1.reactor.wasm b/lib/wasi_snapshot_preview1.reactor.wasm index 887c48a14..c91abe378 100644 Binary files a/lib/wasi_snapshot_preview1.reactor.wasm and b/lib/wasi_snapshot_preview1.reactor.wasm differ diff --git a/packages/preview2-shim/lib/browser/cli.js b/packages/preview2-shim/lib/browser/cli.js index 476a16eb8..a2654118d 100644 --- a/packages/preview2-shim/lib/browser/cli.js +++ b/packages/preview2-shim/lib/browser/cli.js @@ -29,16 +29,19 @@ export const environment = { }; class ComponentExit extends Error { - constructor(ok) { - super(`Component exited ${ok ? 'successfully' : 'with error'}`); + constructor(code) { + super(`Component exited ${code === 0 ? 'successfully' : 'with error'}`); this.exitError = true; - this.ok = ok; + this.code = code; } } export const exit = { exit (status) { - throw new ComponentExit(status.tag === 'err' ? true : false); + throw new ComponentExit(status.tag === 'err' ? 1 : 0); + }, + exitWithCode (code) { + throw new ComponentExit(code); } }; diff --git a/packages/preview2-shim/lib/io/worker-socket-tcp.js b/packages/preview2-shim/lib/io/worker-socket-tcp.js index afdb29e69..b1ae95db4 100644 --- a/packages/preview2-shim/lib/io/worker-socket-tcp.js +++ b/packages/preview2-shim/lib/io/worker-socket-tcp.js @@ -31,7 +31,7 @@ import { } from "./worker-sockets.js"; import { Socket, Server } from "node:net"; -const winOrMac = process.platform === 'win32' || process.platform === 'darwin'; +const win = process.platform === 'win32'; /** * @typedef {import("../../types/interfaces/wasi-sockets-network.js").IpSocketAddress} IpSocketAddress @@ -268,7 +268,7 @@ export function socketTcpGetRemoteAddress(id) { export function socketTcpShutdown(id, _shutdownType) { const socket = tcpSockets.get(id); if (socket.state !== SOCKET_STATE_CONNECTION) throw "invalid-state"; - if (winOrMac && socket.tcpSocket.destroySoon) + if (win && socket.tcpSocket.destroySoon) socket.tcpSocket.destroySoon(); else socket.tcpSocket.destroy(); diff --git a/packages/preview2-shim/lib/io/worker-thread.js b/packages/preview2-shim/lib/io/worker-thread.js index 58beabb16..a08842720 100644 --- a/packages/preview2-shim/lib/io/worker-thread.js +++ b/packages/preview2-shim/lib/io/worker-thread.js @@ -393,8 +393,9 @@ function handle(call, id, payload) { return; } case HTTP_OUTGOING_BODY_DISPOSE: - if (!streams.delete(id)) - throw new Error("wasi-io trap: stream not found to dispose"); + if (debug && !streams.has(id)) + console.warn(`wasi-io: stream ${id} not found to dispose`); + streams.delete(id); return; case HTTP_SERVER_START: return startHttpServer(id, payload); diff --git a/packages/preview2-shim/lib/nodejs/cli.js b/packages/preview2-shim/lib/nodejs/cli.js index 83438f9e9..edb0ee011 100644 --- a/packages/preview2-shim/lib/nodejs/cli.js +++ b/packages/preview2-shim/lib/nodejs/cli.js @@ -47,6 +47,9 @@ export const exit = { exit(status) { process.exit(status.tag === "err" ? 1 : 0); }, + exitWithCode(code) { + process.exit(code); + } }; // Stdin is created as a FILE descriptor diff --git a/packages/preview2-shim/lib/nodejs/filesystem.js b/packages/preview2-shim/lib/nodejs/filesystem.js index e07567337..4e829984d 100644 --- a/packages/preview2-shim/lib/nodejs/filesystem.js +++ b/packages/preview2-shim/lib/nodejs/filesystem.js @@ -368,19 +368,16 @@ class Descriptor { } } try { - const fd = openSync(fullPath, fsOpenFlags); + const fd = openSync(fullPath.endsWith('/') ? fullPath.slice(0, -1) : fullPath, fsOpenFlags); const descriptor = descriptorCreate( fd, descriptorFlags, fullPath, preopenEntries ); - if (fullPath.endsWith("/") && isWindows) { - // check if its a directory - if (descriptor.getType() !== "directory") { - descriptor[symbolDispose](); - throw "not-directory"; - } + if (fullPath.endsWith('/') && descriptor.getType() !== 'directory') { + descriptor[symbolDispose](); + throw "not-directory"; } return descriptor; } catch (e) { @@ -671,6 +668,7 @@ function convertFsError(e) { case "ENOSPC": return "insufficient-space"; case "ENOTDIR": + case 'ERR_FS_EISDIR': return "not-directory"; case "ENOTEMPTY": return "not-empty"; diff --git a/packages/preview2-shim/types/interfaces/wasi-filesystem-types.d.ts b/packages/preview2-shim/types/interfaces/wasi-filesystem-types.d.ts index 3005d6e86..7f2afd766 100644 --- a/packages/preview2-shim/types/interfaces/wasi-filesystem-types.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-filesystem-types.d.ts @@ -569,12 +569,6 @@ export class Descriptor { /** * Open a file or directory. * - * The returned descriptor is not guaranteed to be the lowest-numbered - * descriptor not currently open/ it is randomized to prevent applications - * from depending on making assumptions about indexes, since this is - * error-prone in multi-threaded contexts. The returned descriptor is - * guaranteed to be less than 2**31. - * * If `flags` contains `descriptor-flags::mutate-directory`, and the base * descriptor doesn't have `descriptor-flags::mutate-directory` set, * `open-at` fails with `error-code::read-only`. diff --git a/packages/preview2-shim/types/interfaces/wasi-http-types.d.ts b/packages/preview2-shim/types/interfaces/wasi-http-types.d.ts index 6c0f34a37..25f2e978e 100644 --- a/packages/preview2-shim/types/interfaces/wasi-http-types.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-http-types.d.ts @@ -255,7 +255,7 @@ export interface ErrorCodeInternalError { */ export type HeaderError = HeaderErrorInvalidSyntax | HeaderErrorForbidden | HeaderErrorImmutable; /** - * This error indicates that a `field-key` or `field-value` was + * This error indicates that a `field-name` or `field-value` was * syntactically invalid when used with an operation that sets headers in a * `fields`. */ @@ -263,7 +263,7 @@ export interface HeaderErrorInvalidSyntax { tag: 'invalid-syntax', } /** - * This error indicates that a forbidden `field-key` was used when trying + * This error indicates that a forbidden `field-name` was used when trying * to set a header in a `fields`. */ export interface HeaderErrorForbidden { @@ -278,8 +278,22 @@ export interface HeaderErrorImmutable { } /** * Field keys are always strings. + * + * Field keys should always be treated as case insensitive by the `fields` + * resource for the purposes of equality checking. + * + * # Deprecation + * + * This type has been deprecated in favor of the `field-name` type. */ export type FieldKey = string; +/** + * Field names are always strings. + * + * Field names should always be treated as case insensitive by the `fields` + * resource for the purposes of equality checking. + */ +export type FieldName = FieldKey; /** * Field values should always be ASCII strings. However, in * reality, HTTP implementations often have to interpret malformed values, @@ -312,68 +326,71 @@ export class Fields { * * The resulting `fields` is mutable. * - * The list represents each key-value pair in the Fields. Keys + * The list represents each name-value pair in the Fields. Names * which have multiple values are represented by multiple entries in this - * list with the same key. + * list with the same name. * - * The tuple is a pair of the field key, represented as a string, and + * The tuple is a pair of the field name, represented as a string, and * Value, represented as a list of bytes. * - * An error result will be returned if any `field-key` or `field-value` is + * An error result will be returned if any `field-name` or `field-value` is * syntactically invalid, or if a field is forbidden. */ - static fromList(entries: Array<[FieldKey, FieldValue]>): Fields; + static fromList(entries: Array<[FieldName, FieldValue]>): Fields; /** - * Get all of the values corresponding to a key. If the key is not present + * Get all of the values corresponding to a name. If the name is not present * in this `fields` or is syntactically invalid, an empty list is returned. - * However, if the key is present but empty, this is represented by a list + * However, if the name is present but empty, this is represented by a list * with one or more empty field-values present. */ - get(name: FieldKey): Array; + get(name: FieldName): Array; /** - * Returns `true` when the key is present in this `fields`. If the key is + * Returns `true` when the name is present in this `fields`. If the name is * syntactically invalid, `false` is returned. */ - has(name: FieldKey): boolean; + has(name: FieldName): boolean; /** - * Set all of the values for a key. Clears any existing values for that - * key, if they have been set. + * Set all of the values for a name. Clears any existing values for that + * name, if they have been set. * * Fails with `header-error.immutable` if the `fields` are immutable. * - * Fails with `header-error.invalid-syntax` if the `field-key` or any of + * Fails with `header-error.invalid-syntax` if the `field-name` or any of * the `field-value`s are syntactically invalid. */ - set(name: FieldKey, value: Array): void; + set(name: FieldName, value: Array): void; /** - * Delete all values for a key. Does nothing if no values for the key + * Delete all values for a name. Does nothing if no values for the name * exist. * * Fails with `header-error.immutable` if the `fields` are immutable. * - * Fails with `header-error.invalid-syntax` if the `field-key` is + * Fails with `header-error.invalid-syntax` if the `field-name` is * syntactically invalid. */ - 'delete'(name: FieldKey): void; + 'delete'(name: FieldName): void; /** - * Append a value for a key. Does not change or delete any existing - * values for that key. + * Append a value for a name. Does not change or delete any existing + * values for that name. * * Fails with `header-error.immutable` if the `fields` are immutable. * - * Fails with `header-error.invalid-syntax` if the `field-key` or + * Fails with `header-error.invalid-syntax` if the `field-name` or * `field-value` are syntactically invalid. */ - append(name: FieldKey, value: FieldValue): void; + append(name: FieldName, value: FieldValue): void; /** - * Retrieve the full set of keys and values in the Fields. Like the - * constructor, the list represents each key-value pair. + * Retrieve the full set of names and values in the Fields. Like the + * constructor, the list represents each name-value pair. * - * The outer list represents each key-value pair in the Fields. Keys + * The outer list represents each name-value pair in the Fields. Names * which have multiple values are represented by multiple entries in this - * list with the same key. + * list with the same name. + * + * The names and values are always returned in the original casing and in + * the order in which they will be serialized for transport. */ - entries(): Array<[FieldKey, FieldValue]>; + entries(): Array<[FieldName, FieldValue]>; /** * Make a deep copy of the Fields. Equivalent in behavior to calling the * `fields` constructor on the return value of `entries`. The resulting diff --git a/packages/preview2-shim/types/interfaces/wasi-io-streams.d.ts b/packages/preview2-shim/types/interfaces/wasi-io-streams.d.ts index a52557698..22263ff32 100644 --- a/packages/preview2-shim/types/interfaces/wasi-io-streams.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-io-streams.d.ts @@ -14,6 +14,9 @@ export type StreamError = StreamErrorLastOperationFailed | StreamErrorClosed; * The last operation (a write or flush) failed before completion. * * More information is available in the `error` payload. + * + * After this, the stream will be closed. All future operations return + * `stream-error::closed`. */ export interface StreamErrorLastOperationFailed { tag: 'last-operation-failed', diff --git a/packages/preview2-shim/types/interfaces/wasi-sockets-ip-name-lookup.d.ts b/packages/preview2-shim/types/interfaces/wasi-sockets-ip-name-lookup.d.ts index 3b1fb961a..449ac4c56 100644 --- a/packages/preview2-shim/types/interfaces/wasi-sockets-ip-name-lookup.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-sockets-ip-name-lookup.d.ts @@ -53,7 +53,7 @@ export class ResolveAddressStream { /** * Create a `pollable` which will resolve once the stream is ready for I/O. * - * Note: this function is here for WASI Preview2 only. + * Note: this function is here for WASI 0.2 only. * It's planned to be removed when `future` is natively supported in Preview3. */ subscribe(): Pollable; diff --git a/packages/preview2-shim/types/interfaces/wasi-sockets-tcp.d.ts b/packages/preview2-shim/types/interfaces/wasi-sockets-tcp.d.ts index b6489bc4a..8c2789f16 100644 --- a/packages/preview2-shim/types/interfaces/wasi-sockets-tcp.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-sockets-tcp.d.ts @@ -332,7 +332,7 @@ export class TcpSocket { * See * for more information. * - * Note: this function is here for WASI Preview2 only. + * Note: this function is here for WASI 0.2 only. * It's planned to be removed when `future` is natively supported in Preview3. */ subscribe(): Pollable; diff --git a/packages/preview2-shim/types/interfaces/wasi-sockets-udp.d.ts b/packages/preview2-shim/types/interfaces/wasi-sockets-udp.d.ts index 3ee21ef64..644446c23 100644 --- a/packages/preview2-shim/types/interfaces/wasi-sockets-udp.d.ts +++ b/packages/preview2-shim/types/interfaces/wasi-sockets-udp.d.ts @@ -82,7 +82,7 @@ export class IncomingDatagramStream { /** * Create a `pollable` which will resolve once the stream is ready to receive again. * - * Note: this function is here for WASI Preview2 only. + * Note: this function is here for WASI 0.2 only. * It's planned to be removed when `future` is natively supported in Preview3. */ subscribe(): Pollable; @@ -143,7 +143,7 @@ export class OutgoingDatagramStream { /** * Create a `pollable` which will resolve once the stream is ready to send again. * - * Note: this function is here for WASI Preview2 only. + * Note: this function is here for WASI 0.2 only. * It's planned to be removed when `future` is natively supported in Preview3. */ subscribe(): Pollable; @@ -290,7 +290,7 @@ export class UdpSocket { /** * Create a `pollable` which will resolve once the socket is ready for I/O. * - * Note: this function is here for WASI Preview2 only. + * Note: this function is here for WASI 0.2 only. * It's planned to be removed when `future` is natively supported in Preview3. */ subscribe(): Pollable; diff --git a/submodules/WASI-Virt b/submodules/WASI-Virt index 78cce852f..8900d799f 160000 --- a/submodules/WASI-Virt +++ b/submodules/WASI-Virt @@ -1 +1 @@ -Subproject commit 78cce852fd35098defecfbfbac92d0dd8b744500 +Subproject commit 8900d799fa38a43ad5f55d446e8acf6df1a53adb diff --git a/submodules/wasm-tools b/submodules/wasm-tools index 9eaaf5fb7..c9218cf2f 160000 --- a/submodules/wasm-tools +++ b/submodules/wasm-tools @@ -1 +1 @@ -Subproject commit 9eaaf5fb704760bd56c37b4b78d2c1e731e9d0a8 +Subproject commit c9218cf2f439ff38bdb6fbf172fcc237b971ea03 diff --git a/submodules/wasmtime b/submodules/wasmtime index 38e30ffb0..e01f9508f 160000 --- a/submodules/wasmtime +++ b/submodules/wasmtime @@ -1 +1 @@ -Subproject commit 38e30ffb0fcd6b73ea6deab37e209e384ff30b6d +Subproject commit e01f9508f71ef176de2e517672fcc440ce9ff478 diff --git a/submodules/wit-bindgen b/submodules/wit-bindgen index 5fe533638..20d33b525 160000 --- a/submodules/wit-bindgen +++ b/submodules/wit-bindgen @@ -1 +1 @@ -Subproject commit 5fe533638d0b23981a3eba6a27435ec20750f192 +Subproject commit 20d33b525e766451a621f57a48d5d2cbe7f779fd diff --git a/test/api.js b/test/api.js index ed2f5bc42..ee9197842 100644 --- a/test/api.js +++ b/test/api.js @@ -16,7 +16,7 @@ import { platform } from "node:process"; const isWindows = platform === "win32"; -export async function apiTest(fixtures) { +export async function apiTest(_fixtures) { suite("API", () => { test("Transpile", async () => { const name = "flavorful"; @@ -154,7 +154,7 @@ export async function apiTest(fixtures) { [ "processed-by", [ - ["wit-component", "0.217.0"], + ["wit-component", "0.218.0"], ["dummy-gen", "test"], ], ], @@ -195,7 +195,7 @@ export async function apiTest(fixtures) { [ "processed-by", [ - ["wit-component", "0.217.0"], + ["wit-component", "0.218.0"], ["dummy-gen", "test"], ], ], diff --git a/test/cli.js b/test/cli.js index 47b69899a..68a459f43 100644 --- a/test/cli.js +++ b/test/cli.js @@ -1,6 +1,5 @@ -import { resolve, normalize, sep } from "node:path"; +import { resolve } from "node:path"; import { execArgv } from "node:process"; -import { tmpdir, EOL } from "node:os"; import { deepStrictEqual, ok, strictEqual } from "node:assert"; import { mkdir, @@ -8,7 +7,6 @@ import { rm, symlink, writeFile, - mkdtemp, } from "node:fs/promises"; import { fileURLToPath, pathToFileURL } from "url"; @@ -18,7 +16,7 @@ const multiMemory = execArgv.includes("--experimental-wasm-multi-memory") ? ["--multi-memory"] : []; -export async function cliTest(fixtures) { +export async function cliTest(_fixtures) { suite("CLI", () => { var tmpDir; var outDir; @@ -462,7 +460,7 @@ export async function cliTest(fixtures) { [ "processed-by", [ - ["wit-component", "0.217.0"], + ["wit-component", "0.218.0"], ["dummy-gen", "test"], ], ], @@ -505,7 +503,7 @@ export async function cliTest(fixtures) { ]); }); - test("Componentize", async () => { + test.skip("Componentize", async () => { const { stdout, stderr } = await exec( jcoPath, "componentize", diff --git a/test/fixtures/componentize/wasi-http-proxy/source.js b/test/fixtures/componentize/wasi-http-proxy/source.js index 445df767b..2ddb0bf2c 100644 --- a/test/fixtures/componentize/wasi-http-proxy/source.js +++ b/test/fixtures/componentize/wasi-http-proxy/source.js @@ -1,9 +1,9 @@ -import { handle } from 'wasi:http/outgoing-handler@0.2.1'; +import { handle } from 'wasi:http/outgoing-handler@0.2.2'; import { Fields, OutgoingRequest, OutgoingBody, -} from 'wasi:http/types@0.2.1'; +} from 'wasi:http/types@0.2.2'; const sendRequest = ( method, diff --git a/test/fixtures/wit/deps/cli/command.wit b/test/fixtures/wit/deps/cli/command.wit index dc064a3cd..cc7a352c2 100644 --- a/test/fixtures/wit/deps/cli/command.wit +++ b/test/fixtures/wit/deps/cli/command.wit @@ -1,4 +1,4 @@ -package wasi:cli@0.2.1; +package wasi:cli@0.2.2; @since(version = 0.2.0) world command { diff --git a/test/fixtures/wit/deps/cli/imports.wit b/test/fixtures/wit/deps/cli/imports.wit index b8339d3b2..ebd7ba173 100644 --- a/test/fixtures/wit/deps/cli/imports.wit +++ b/test/fixtures/wit/deps/cli/imports.wit @@ -1,17 +1,17 @@ -package wasi:cli@0.2.1; +package wasi:cli@0.2.2; @since(version = 0.2.0) world imports { @since(version = 0.2.0) - include wasi:clocks/imports@0.2.1; + include wasi:clocks/imports@0.2.2; @since(version = 0.2.0) - include wasi:filesystem/imports@0.2.1; + include wasi:filesystem/imports@0.2.2; @since(version = 0.2.0) - include wasi:sockets/imports@0.2.1; + include wasi:sockets/imports@0.2.2; @since(version = 0.2.0) - include wasi:random/imports@0.2.1; + include wasi:random/imports@0.2.2; @since(version = 0.2.0) - include wasi:io/imports@0.2.1; + include wasi:io/imports@0.2.2; @since(version = 0.2.0) import environment; diff --git a/test/fixtures/wit/deps/cli/stdio.wit b/test/fixtures/wit/deps/cli/stdio.wit index d1d26eb61..860313eea 100644 --- a/test/fixtures/wit/deps/cli/stdio.wit +++ b/test/fixtures/wit/deps/cli/stdio.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface stdin { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{input-stream}; + use wasi:io/streams@0.2.2.{input-stream}; @since(version = 0.2.0) get-stdin: func() -> input-stream; @@ -10,7 +10,7 @@ interface stdin { @since(version = 0.2.0) interface stdout { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{output-stream}; + use wasi:io/streams@0.2.2.{output-stream}; @since(version = 0.2.0) get-stdout: func() -> output-stream; @@ -19,7 +19,7 @@ interface stdout { @since(version = 0.2.0) interface stderr { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{output-stream}; + use wasi:io/streams@0.2.2.{output-stream}; @since(version = 0.2.0) get-stderr: func() -> output-stream; diff --git a/test/fixtures/wit/deps/clocks/monotonic-clock.wit b/test/fixtures/wit/deps/clocks/monotonic-clock.wit index 3c24840c9..233cace4c 100644 --- a/test/fixtures/wit/deps/clocks/monotonic-clock.wit +++ b/test/fixtures/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -10,7 +10,7 @@ package wasi:clocks@0.2.1; @since(version = 0.2.0) interface monotonic-clock { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from diff --git a/test/fixtures/wit/deps/clocks/timezone.wit b/test/fixtures/wit/deps/clocks/timezone.wit index 212da6682..349fb5703 100644 --- a/test/fixtures/wit/deps/clocks/timezone.wit +++ b/test/fixtures/wit/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; @unstable(feature = clocks-timezone) interface timezone { diff --git a/test/fixtures/wit/deps/clocks/wall-clock.wit b/test/fixtures/wit/deps/clocks/wall-clock.wit index 6be069a32..ec05a1f1a 100644 --- a/test/fixtures/wit/deps/clocks/wall-clock.wit +++ b/test/fixtures/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; /// WASI Wall Clock is a clock API intended to let users query the current /// time. The name "wall" makes an analogy to a "clock on the wall", which /// is not necessarily monotonic as it may be reset. diff --git a/test/fixtures/wit/deps/clocks/world.wit b/test/fixtures/wit/deps/clocks/world.wit index 9251ac645..e36802cc8 100644 --- a/test/fixtures/wit/deps/clocks/world.wit +++ b/test/fixtures/wit/deps/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; @since(version = 0.2.0) world imports { diff --git a/test/fixtures/wit/deps/filesystem/preopens.wit b/test/fixtures/wit/deps/filesystem/preopens.wit index ca2f726af..410bec1dc 100644 --- a/test/fixtures/wit/deps/filesystem/preopens.wit +++ b/test/fixtures/wit/deps/filesystem/preopens.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.1; +package wasi:filesystem@0.2.2; @since(version = 0.2.0) interface preopens { diff --git a/test/fixtures/wit/deps/filesystem/types.wit b/test/fixtures/wit/deps/filesystem/types.wit index db3d96867..49e0a30bb 100644 --- a/test/fixtures/wit/deps/filesystem/types.wit +++ b/test/fixtures/wit/deps/filesystem/types.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.1; +package wasi:filesystem@0.2.2; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without /// significant overhead. @@ -26,9 +26,9 @@ package wasi:filesystem@0.2.1; @since(version = 0.2.0) interface types { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{input-stream, output-stream, error}; + use wasi:io/streams@0.2.2.{input-stream, output-stream, error}; @since(version = 0.2.0) - use wasi:clocks/wall-clock@0.2.1.{datetime}; + use wasi:clocks/wall-clock@0.2.2.{datetime}; /// File size or length of a region within a file. @since(version = 0.2.0) @@ -523,12 +523,6 @@ interface types { /// Open a file or directory. /// - /// The returned descriptor is not guaranteed to be the lowest-numbered - /// descriptor not currently open/ it is randomized to prevent applications - /// from depending on making assumptions about indexes, since this is - /// error-prone in multi-threaded contexts. The returned descriptor is - /// guaranteed to be less than 2**31. - /// /// If `flags` contains `descriptor-flags::mutate-directory`, and the base /// descriptor doesn't have `descriptor-flags::mutate-directory` set, /// `open-at` fails with `error-code::read-only`. diff --git a/test/fixtures/wit/deps/filesystem/world.wit b/test/fixtures/wit/deps/filesystem/world.wit index af0146cbc..8064bd64b 100644 --- a/test/fixtures/wit/deps/filesystem/world.wit +++ b/test/fixtures/wit/deps/filesystem/world.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.1; +package wasi:filesystem@0.2.2; @since(version = 0.2.0) world imports { diff --git a/test/fixtures/wit/deps/http/proxy.wit b/test/fixtures/wit/deps/http/proxy.wit index 415d2ee1c..fadb89a3e 100644 --- a/test/fixtures/wit/deps/http/proxy.wit +++ b/test/fixtures/wit/deps/http/proxy.wit @@ -1,4 +1,4 @@ -package wasi:http@0.2.1; +package wasi:http@0.2.2; /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. /// It is intended to be `include`d in other worlds. @@ -6,25 +6,25 @@ package wasi:http@0.2.1; world imports { /// HTTP proxies have access to time and randomness. @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.1; + import wasi:clocks/monotonic-clock@0.2.2; @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.1; + import wasi:clocks/wall-clock@0.2.2; @since(version = 0.2.0) - import wasi:random/random@0.2.1; + import wasi:random/random@0.2.2; /// Proxies have standard output and error streams which are expected to /// terminate in a developer-facing console provided by the host. @since(version = 0.2.0) - import wasi:cli/stdout@0.2.1; + import wasi:cli/stdout@0.2.2; @since(version = 0.2.0) - import wasi:cli/stderr@0.2.1; + import wasi:cli/stderr@0.2.2; /// TODO: this is a temporary workaround until component tooling is able to /// gracefully handle the absence of stdin. Hosts must return an eof stream /// for this import, which is what wasi-libc + tooling will do automatically /// when this import is properly removed. @since(version = 0.2.0) - import wasi:cli/stdin@0.2.1; + import wasi:cli/stdin@0.2.2; /// This is the default handler to use when user code simply wants to make an /// HTTP request (e.g., via `fetch()`). diff --git a/test/fixtures/wit/deps/http/types.wit b/test/fixtures/wit/deps/http/types.wit index 3c45cd08b..40ee77068 100644 --- a/test/fixtures/wit/deps/http/types.wit +++ b/test/fixtures/wit/deps/http/types.wit @@ -4,13 +4,13 @@ @since(version = 0.2.0) interface types { @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.1.{duration}; + use wasi:clocks/monotonic-clock@0.2.2.{duration}; @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{input-stream, output-stream}; + use wasi:io/streams@0.2.2.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/error@0.2.1.{error as io-error}; + use wasi:io/error@0.2.2.{error as io-error}; @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; /// This type corresponds to HTTP standard Methods. @since(version = 0.2.0) @@ -124,12 +124,12 @@ interface types { /// setting or appending to a `fields` resource. @since(version = 0.2.0) variant header-error { - /// This error indicates that a `field-key` or `field-value` was + /// This error indicates that a `field-name` or `field-value` was /// syntactically invalid when used with an operation that sets headers in a /// `fields`. invalid-syntax, - /// This error indicates that a forbidden `field-key` was used when trying + /// This error indicates that a forbidden `field-name` was used when trying /// to set a header in a `fields`. forbidden, @@ -138,8 +138,23 @@ interface types { immutable, } + /// Field names are always strings. + /// + /// Field names should always be treated as case insensitive by the `fields` + /// resource for the purposes of equality checking. + @since(version = 0.2.1) + type field-name = field-key; + /// Field keys are always strings. + /// + /// Field keys should always be treated as case insensitive by the `fields` + /// resource for the purposes of equality checking. + /// + /// # Deprecation + /// + /// This type has been deprecated in favor of the `field-name` type. @since(version = 0.2.0) + @deprecated(version = 0.2.2) type field-key = string; /// Field values should always be ASCII strings. However, in @@ -171,70 +186,73 @@ interface types { /// /// The resulting `fields` is mutable. /// - /// The list represents each key-value pair in the Fields. Keys + /// The list represents each name-value pair in the Fields. Names /// which have multiple values are represented by multiple entries in this - /// list with the same key. + /// list with the same name. /// - /// The tuple is a pair of the field key, represented as a string, and + /// The tuple is a pair of the field name, represented as a string, and /// Value, represented as a list of bytes. /// - /// An error result will be returned if any `field-key` or `field-value` is + /// An error result will be returned if any `field-name` or `field-value` is /// syntactically invalid, or if a field is forbidden. @since(version = 0.2.0) from-list: static func( - entries: list> + entries: list> ) -> result; - /// Get all of the values corresponding to a key. If the key is not present + /// Get all of the values corresponding to a name. If the name is not present /// in this `fields` or is syntactically invalid, an empty list is returned. - /// However, if the key is present but empty, this is represented by a list + /// However, if the name is present but empty, this is represented by a list /// with one or more empty field-values present. @since(version = 0.2.0) - get: func(name: field-key) -> list; + get: func(name: field-name) -> list; - /// Returns `true` when the key is present in this `fields`. If the key is + /// Returns `true` when the name is present in this `fields`. If the name is /// syntactically invalid, `false` is returned. @since(version = 0.2.0) - has: func(name: field-key) -> bool; + has: func(name: field-name) -> bool; - /// Set all of the values for a key. Clears any existing values for that - /// key, if they have been set. + /// Set all of the values for a name. Clears any existing values for that + /// name, if they have been set. /// /// Fails with `header-error.immutable` if the `fields` are immutable. /// - /// Fails with `header-error.invalid-syntax` if the `field-key` or any of + /// Fails with `header-error.invalid-syntax` if the `field-name` or any of /// the `field-value`s are syntactically invalid. @since(version = 0.2.0) - set: func(name: field-key, value: list) -> result<_, header-error>; + set: func(name: field-name, value: list) -> result<_, header-error>; - /// Delete all values for a key. Does nothing if no values for the key + /// Delete all values for a name. Does nothing if no values for the name /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. /// - /// Fails with `header-error.invalid-syntax` if the `field-key` is + /// Fails with `header-error.invalid-syntax` if the `field-name` is /// syntactically invalid. @since(version = 0.2.0) - delete: func(name: field-key) -> result<_, header-error>; + delete: func(name: field-name) -> result<_, header-error>; - /// Append a value for a key. Does not change or delete any existing - /// values for that key. + /// Append a value for a name. Does not change or delete any existing + /// values for that name. /// /// Fails with `header-error.immutable` if the `fields` are immutable. /// - /// Fails with `header-error.invalid-syntax` if the `field-key` or + /// Fails with `header-error.invalid-syntax` if the `field-name` or /// `field-value` are syntactically invalid. @since(version = 0.2.0) - append: func(name: field-key, value: field-value) -> result<_, header-error>; + append: func(name: field-name, value: field-value) -> result<_, header-error>; - /// Retrieve the full set of keys and values in the Fields. Like the - /// constructor, the list represents each key-value pair. + /// Retrieve the full set of names and values in the Fields. Like the + /// constructor, the list represents each name-value pair. /// - /// The outer list represents each key-value pair in the Fields. Keys + /// The outer list represents each name-value pair in the Fields. Names /// which have multiple values are represented by multiple entries in this - /// list with the same key. + /// list with the same name. + /// + /// The names and values are always returned in the original casing and in + /// the order in which they will be serialized for transport. @since(version = 0.2.0) - entries: func() -> list>; + entries: func() -> list>; /// Make a deep copy of the Fields. Equivalent in behavior to calling the /// `fields` constructor on the return value of `entries`. The resulting diff --git a/test/fixtures/wit/deps/io/error.wit b/test/fixtures/wit/deps/io/error.wit index 4ea29c469..717135f8c 100644 --- a/test/fixtures/wit/deps/io/error.wit +++ b/test/fixtures/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; @since(version = 0.2.0) interface error { diff --git a/test/fixtures/wit/deps/io/poll.wit b/test/fixtures/wit/deps/io/poll.wit index b25ac729f..49c1c5ede 100644 --- a/test/fixtures/wit/deps/io/poll.wit +++ b/test/fixtures/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/test/fixtures/wit/deps/io/streams.wit b/test/fixtures/wit/deps/io/streams.wit index b697e24d6..330f7095c 100644 --- a/test/fixtures/wit/deps/io/streams.wit +++ b/test/fixtures/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. @@ -18,6 +18,9 @@ interface streams { /// The last operation (a write or flush) failed before completion. /// /// More information is available in the `error` payload. + /// + /// After this, the stream will be closed. All future operations return + /// `stream-error::closed`. last-operation-failed(error), /// The stream is closed: no more input will be accepted by the /// stream. A closed output-stream will return this error on all @@ -205,6 +208,7 @@ interface streams { /// The created `pollable` is a child resource of the `output-stream`. /// Implementations may trap if the `output-stream` is dropped before /// all derived `pollable`s created with this function are dropped. + @since(version = 0.2.0) subscribe: func() -> pollable; /// Write zeroes to a stream. diff --git a/test/fixtures/wit/deps/io/world.wit b/test/fixtures/wit/deps/io/world.wit index 6405a4e48..f7001ccff 100644 --- a/test/fixtures/wit/deps/io/world.wit +++ b/test/fixtures/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; @since(version = 0.2.0) world imports { diff --git a/test/fixtures/wit/deps/random/insecure-seed.wit b/test/fixtures/wit/deps/random/insecure-seed.wit index 7e708dc52..cdea716cf 100644 --- a/test/fixtures/wit/deps/random/insecure-seed.wit +++ b/test/fixtures/wit/deps/random/insecure-seed.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.1; +package wasi:random@0.2.2; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/test/fixtures/wit/deps/random/insecure.wit b/test/fixtures/wit/deps/random/insecure.wit index 3cdb53dfb..b71e85879 100644 --- a/test/fixtures/wit/deps/random/insecure.wit +++ b/test/fixtures/wit/deps/random/insecure.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.1; +package wasi:random@0.2.2; /// The insecure interface for insecure pseudo-random numbers. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/test/fixtures/wit/deps/random/random.wit b/test/fixtures/wit/deps/random/random.wit index 2b5035d1c..0c57e8c80 100644 --- a/test/fixtures/wit/deps/random/random.wit +++ b/test/fixtures/wit/deps/random/random.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.1; +package wasi:random@0.2.2; /// WASI Random is a random data API. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/test/fixtures/wit/deps/random/world.wit b/test/fixtures/wit/deps/random/world.wit index c615e96dc..16d68acfa 100644 --- a/test/fixtures/wit/deps/random/world.wit +++ b/test/fixtures/wit/deps/random/world.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.1; +package wasi:random@0.2.2; @since(version = 0.2.0) world imports { diff --git a/test/fixtures/wit/deps/sockets/ip-name-lookup.wit b/test/fixtures/wit/deps/sockets/ip-name-lookup.wit index dc56f3000..d3ab88aed 100644 --- a/test/fixtures/wit/deps/sockets/ip-name-lookup.wit +++ b/test/fixtures/wit/deps/sockets/ip-name-lookup.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface ip-name-lookup { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; @@ -48,7 +48,7 @@ interface ip-name-lookup { /// Create a `pollable` which will resolve once the stream is ready for I/O. /// - /// Note: this function is here for WASI Preview2 only. + /// Note: this function is here for WASI 0.2 only. /// It's planned to be removed when `future` is natively supported in Preview3. @since(version = 0.2.0) subscribe: func() -> pollable; diff --git a/test/fixtures/wit/deps/sockets/network.wit b/test/fixtures/wit/deps/sockets/network.wit index 8c13b348e..7f2d86a4c 100644 --- a/test/fixtures/wit/deps/sockets/network.wit +++ b/test/fixtures/wit/deps/sockets/network.wit @@ -1,5 +1,8 @@ @since(version = 0.2.0) interface network { + @unstable(feature = network-error-code) + use wasi:io/error@0.2.2.{error}; + /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. /// There is no need for this to map 1:1 to a physical network interface. @@ -105,6 +108,19 @@ interface network { permanent-resolver-failure, } + /// Attempts to extract a network-related `error-code` from the stream + /// `error` provided. + /// + /// Stream operations which return `stream-error::last-operation-failed` + /// have a payload with more information about the operation that failed. + /// This payload can be passed through to this function to see if there's + /// network-related information about the error to return. + /// + /// Note that this function is fallible because not all stream-related + /// errors are network-related errors. + @unstable(feature = network-error-code) + network-error-code: func(err: borrow) -> option; + @since(version = 0.2.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. diff --git a/test/fixtures/wit/deps/sockets/tcp.wit b/test/fixtures/wit/deps/sockets/tcp.wit index bae5a29ec..728822dfa 100644 --- a/test/fixtures/wit/deps/sockets/tcp.wit +++ b/test/fixtures/wit/deps/sockets/tcp.wit @@ -1,11 +1,11 @@ @since(version = 0.2.0) interface tcp { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{input-stream, output-stream}; + use wasi:io/streams@0.2.2.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.1.{duration}; + use wasi:clocks/monotonic-clock@0.2.2.{duration}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; @@ -353,7 +353,7 @@ interface tcp { /// See /// for more information. /// - /// Note: this function is here for WASI Preview2 only. + /// Note: this function is here for WASI 0.2 only. /// It's planned to be removed when `future` is natively supported in Preview3. @since(version = 0.2.0) subscribe: func() -> pollable; diff --git a/test/fixtures/wit/deps/sockets/udp.wit b/test/fixtures/wit/deps/sockets/udp.wit index b289e4943..d8acb2d29 100644 --- a/test/fixtures/wit/deps/sockets/udp.wit +++ b/test/fixtures/wit/deps/sockets/udp.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface udp { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; @@ -184,7 +184,7 @@ interface udp { /// Create a `pollable` which will resolve once the socket is ready for I/O. /// - /// Note: this function is here for WASI Preview2 only. + /// Note: this function is here for WASI 0.2 only. /// It's planned to be removed when `future` is natively supported in Preview3. @since(version = 0.2.0) subscribe: func() -> pollable; @@ -220,7 +220,7 @@ interface udp { /// Create a `pollable` which will resolve once the stream is ready to receive again. /// - /// Note: this function is here for WASI Preview2 only. + /// Note: this function is here for WASI 0.2 only. /// It's planned to be removed when `future` is natively supported in Preview3. @since(version = 0.2.0) subscribe: func() -> pollable; @@ -280,7 +280,7 @@ interface udp { /// Create a `pollable` which will resolve once the stream is ready to send again. /// - /// Note: this function is here for WASI Preview2 only. + /// Note: this function is here for WASI 0.2 only. /// It's planned to be removed when `future` is natively supported in Preview3. @since(version = 0.2.0) subscribe: func() -> pollable; diff --git a/test/fixtures/wit/deps/sockets/world.wit b/test/fixtures/wit/deps/sockets/world.wit index a1d42670e..6e349c756 100644 --- a/test/fixtures/wit/deps/sockets/world.wit +++ b/test/fixtures/wit/deps/sockets/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.1; +package wasi:sockets@0.2.2; @since(version = 0.2.0) world imports { diff --git a/test/fixtures/wit/wasi-http.wit b/test/fixtures/wit/wasi-http.wit index edb99b7b9..f48d636c2 100644 --- a/test/fixtures/wit/wasi-http.wit +++ b/test/fixtures/wit/wasi-http.wit @@ -10,7 +10,7 @@ interface commands { } world command-extended { - include wasi:http/proxy@0.2.1; + include wasi:http/proxy@0.2.2; export commands; } diff --git a/tests/generated/api_proxy.rs b/tests/generated/api_proxy.rs deleted file mode 100644 index 1adf303e2..000000000 --- a/tests/generated/api_proxy.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn api_proxy() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "api_proxy"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/api_proxy"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/api_proxy --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/api_proxy_streaming.rs b/tests/generated/api_proxy_streaming.rs deleted file mode 100644 index 6e8339902..000000000 --- a/tests/generated/api_proxy_streaming.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn api_proxy_streaming() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "api_proxy_streaming"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/api_proxy_streaming"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/api_proxy_streaming --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/api_reactor.rs b/tests/generated/api_reactor.rs deleted file mode 100644 index 2d62d81ba..000000000 --- a/tests/generated/api_reactor.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn api_reactor() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "api_reactor"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/api_reactor"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/api_reactor --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/api_read_only.rs b/tests/generated/api_read_only.rs deleted file mode 100644 index 3282fe2b0..000000000 --- a/tests/generated/api_read_only.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -// use tempdir::TempDir; -// use xshell::{cmd, Shell}; - -#[test] -fn api_read_only() -> anyhow::Result<()> { - // let sh = Shell::new()?; - // let file_name = "api_read_only"; - // let tempdir = TempDir::new("{file_name}")?; - // let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/api_read_only"); - - // let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/api_read_only --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - // let cmd = cmd.env("JCO_RUN_PATH", "deno").env("JCO_RUN_ARGS", "run --importmap importmap.json -A");cmd.run()?; - panic!("skipped"); // Ok(()) -} diff --git a/tests/generated/api_time.rs b/tests/generated/api_time.rs deleted file mode 100644 index 35f50519a..000000000 --- a/tests/generated/api_time.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn api_time() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "api_time"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/api_time"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/api_time --jco-import ./tests/virtualenvs/fakeclocks.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_args.rs b/tests/generated/cli_args.rs deleted file mode 100644 index f0a7cabc4..000000000 --- a/tests/generated/cli_args.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_args() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_args"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_args"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_args --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_default_clocks.rs b/tests/generated/cli_default_clocks.rs deleted file mode 100644 index 1d53d2abc..000000000 --- a/tests/generated/cli_default_clocks.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_default_clocks() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_default_clocks"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_default_clocks"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_default_clocks --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_directory_list.rs b/tests/generated/cli_directory_list.rs deleted file mode 100644 index 4e1386b43..000000000 --- a/tests/generated/cli_directory_list.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_directory_list() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_directory_list"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_directory_list"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_directory_list --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_env.rs b/tests/generated/cli_env.rs deleted file mode 100644 index 51a41254c..000000000 --- a/tests/generated/cli_env.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_env() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_env"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_env"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_env --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_exit_default.rs b/tests/generated/cli_exit_default.rs deleted file mode 100644 index 02d12ac81..000000000 --- a/tests/generated/cli_exit_default.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_exit_default() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_exit_default"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_exit_default"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_exit_default --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_exit_failure.rs b/tests/generated/cli_exit_failure.rs deleted file mode 100644 index f49a0d690..000000000 --- a/tests/generated/cli_exit_failure.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_exit_failure() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_exit_failure"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_exit_failure"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_exit_failure --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run().expect_err("test should exit with code 1"); - Ok(()) -} diff --git a/tests/generated/cli_exit_panic.rs b/tests/generated/cli_exit_panic.rs deleted file mode 100644 index 2495c6497..000000000 --- a/tests/generated/cli_exit_panic.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_exit_panic() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_exit_panic"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_exit_panic"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_exit_panic --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run().expect_err("test should exit with code 1"); - Ok(()) -} diff --git a/tests/generated/cli_exit_success.rs b/tests/generated/cli_exit_success.rs deleted file mode 100644 index fef9e9280..000000000 --- a/tests/generated/cli_exit_success.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_exit_success() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_exit_success"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_exit_success"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_exit_success --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_export_cabi_realloc.rs b/tests/generated/cli_export_cabi_realloc.rs deleted file mode 100644 index a33f9106e..000000000 --- a/tests/generated/cli_export_cabi_realloc.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_export_cabi_realloc() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_export_cabi_realloc"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_export_cabi_realloc"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_export_cabi_realloc --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_file_append.rs b/tests/generated/cli_file_append.rs deleted file mode 100644 index f3b4a98c7..000000000 --- a/tests/generated/cli_file_append.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_file_append() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_file_append"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_file_append"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_file_append --jco-import ./tests/virtualenvs/bar-jabberwock.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_file_dir_sync.rs b/tests/generated/cli_file_dir_sync.rs deleted file mode 100644 index 7903d54d0..000000000 --- a/tests/generated/cli_file_dir_sync.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_file_dir_sync() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_file_dir_sync"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_file_dir_sync"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_file_dir_sync --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_file_read.rs b/tests/generated/cli_file_read.rs deleted file mode 100644 index 231548b1e..000000000 --- a/tests/generated/cli_file_read.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_file_read() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_file_read"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_file_read"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_file_read --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_hello_stdout.rs b/tests/generated/cli_hello_stdout.rs deleted file mode 100644 index ecff4a299..000000000 --- a/tests/generated/cli_hello_stdout.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_hello_stdout() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_hello_stdout"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_hello_stdout"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_hello_stdout --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_splice_stdin.rs b/tests/generated/cli_splice_stdin.rs deleted file mode 100644 index 8b66dd277..000000000 --- a/tests/generated/cli_splice_stdin.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_splice_stdin() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_splice_stdin"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_splice_stdin"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_splice_stdin --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_stdin.rs b/tests/generated/cli_stdin.rs deleted file mode 100644 index 1dd5641c7..000000000 --- a/tests/generated/cli_stdin.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_stdin() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_stdin"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_stdin"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_stdin --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - let cmd = cmd.stdin(b"So rested he by the Tumtum tree"); - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/cli_stdio_write_flushes.rs b/tests/generated/cli_stdio_write_flushes.rs deleted file mode 100644 index f9e5f5054..000000000 --- a/tests/generated/cli_stdio_write_flushes.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn cli_stdio_write_flushes() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "cli_stdio_write_flushes"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/cli_stdio_write_flushes"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/cli_stdio_write_flushes --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_content_length.rs b/tests/generated/http_outbound_request_content_length.rs deleted file mode 100644 index f72fcfaed..000000000 --- a/tests/generated/http_outbound_request_content_length.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_content_length() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_content_length"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_content_length"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_content_length --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_get.rs b/tests/generated/http_outbound_request_get.rs deleted file mode 100644 index 2e1be5913..000000000 --- a/tests/generated/http_outbound_request_get.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_get() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_get"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_get"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_get --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_invalid_dnsname.rs b/tests/generated/http_outbound_request_invalid_dnsname.rs deleted file mode 100644 index 84d21f167..000000000 --- a/tests/generated/http_outbound_request_invalid_dnsname.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_invalid_dnsname() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_invalid_dnsname"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_invalid_dnsname"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_invalid_dnsname --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_invalid_header.rs b/tests/generated/http_outbound_request_invalid_header.rs deleted file mode 100644 index 49922ac8d..000000000 --- a/tests/generated/http_outbound_request_invalid_header.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_invalid_header() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_invalid_header"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_invalid_header"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_invalid_header --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_invalid_port.rs b/tests/generated/http_outbound_request_invalid_port.rs deleted file mode 100644 index 1b64923ce..000000000 --- a/tests/generated/http_outbound_request_invalid_port.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_invalid_port() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_invalid_port"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_invalid_port"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_invalid_port --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_invalid_version.rs b/tests/generated/http_outbound_request_invalid_version.rs deleted file mode 100644 index 513050f30..000000000 --- a/tests/generated/http_outbound_request_invalid_version.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_invalid_version() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_invalid_version"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_invalid_version"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_invalid_version --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_large_post.rs b/tests/generated/http_outbound_request_large_post.rs deleted file mode 100644 index 2de24188b..000000000 --- a/tests/generated/http_outbound_request_large_post.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_large_post() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_large_post"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_large_post"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_large_post --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_post.rs b/tests/generated/http_outbound_request_post.rs deleted file mode 100644 index 576437fa1..000000000 --- a/tests/generated/http_outbound_request_post.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_post() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_post"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_post"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_post --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_put.rs b/tests/generated/http_outbound_request_put.rs deleted file mode 100644 index c03e73952..000000000 --- a/tests/generated/http_outbound_request_put.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_put() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_put"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_put"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_put --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_response_build.rs b/tests/generated/http_outbound_request_response_build.rs deleted file mode 100644 index 430e70c9d..000000000 --- a/tests/generated/http_outbound_request_response_build.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_response_build() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_response_build"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_response_build"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_response_build --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_unknown_method.rs b/tests/generated/http_outbound_request_unknown_method.rs deleted file mode 100644 index 0295838b3..000000000 --- a/tests/generated/http_outbound_request_unknown_method.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_unknown_method() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_unknown_method"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_unknown_method"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_unknown_method --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/http_outbound_request_unsupported_scheme.rs b/tests/generated/http_outbound_request_unsupported_scheme.rs deleted file mode 100644 index c59efbd91..000000000 --- a/tests/generated/http_outbound_request_unsupported_scheme.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn http_outbound_request_unsupported_scheme() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "http_outbound_request_unsupported_scheme"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/http_outbound_request_unsupported_scheme"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/http_outbound_request_unsupported_scheme --jco-import ./tests/virtualenvs/http.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_big_random_buf.rs b/tests/generated/preview1_big_random_buf.rs deleted file mode 100644 index ce7c1fa55..000000000 --- a/tests/generated/preview1_big_random_buf.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_big_random_buf() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_big_random_buf"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_big_random_buf"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_big_random_buf --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_clock_time_get.rs b/tests/generated/preview1_clock_time_get.rs deleted file mode 100644 index 8f86dd712..000000000 --- a/tests/generated/preview1_clock_time_get.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_clock_time_get() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_clock_time_get"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_clock_time_get"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_clock_time_get --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_close_preopen.rs b/tests/generated/preview1_close_preopen.rs deleted file mode 100644 index a0ce6d4e2..000000000 --- a/tests/generated/preview1_close_preopen.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_close_preopen() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_close_preopen"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_close_preopen"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_close_preopen --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_dangling_fd.rs b/tests/generated/preview1_dangling_fd.rs deleted file mode 100644 index 038abcffd..000000000 --- a/tests/generated/preview1_dangling_fd.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_dangling_fd() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_dangling_fd"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_dangling_fd"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_dangling_fd --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_dangling_symlink.rs b/tests/generated/preview1_dangling_symlink.rs deleted file mode 100644 index 1f6107013..000000000 --- a/tests/generated/preview1_dangling_symlink.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_dangling_symlink() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_dangling_symlink"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_dangling_symlink"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_dangling_symlink --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_dir_fd_op_failures.rs b/tests/generated/preview1_dir_fd_op_failures.rs deleted file mode 100644 index 8ce3d3602..000000000 --- a/tests/generated/preview1_dir_fd_op_failures.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_dir_fd_op_failures() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_dir_fd_op_failures"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_dir_fd_op_failures"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_dir_fd_op_failures --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_directory_seek.rs b/tests/generated/preview1_directory_seek.rs deleted file mode 100644 index 1b79268a4..000000000 --- a/tests/generated/preview1_directory_seek.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_directory_seek() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_directory_seek"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_directory_seek"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_directory_seek --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_fd_advise.rs b/tests/generated/preview1_fd_advise.rs deleted file mode 100644 index 174752d46..000000000 --- a/tests/generated/preview1_fd_advise.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_fd_advise() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_fd_advise"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_fd_advise"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_fd_advise --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_fd_filestat_get.rs b/tests/generated/preview1_fd_filestat_get.rs deleted file mode 100644 index 132a39bbf..000000000 --- a/tests/generated/preview1_fd_filestat_get.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_fd_filestat_get() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_fd_filestat_get"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_fd_filestat_get"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_fd_filestat_get --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_fd_filestat_set.rs b/tests/generated/preview1_fd_filestat_set.rs deleted file mode 100644 index eeb4517a2..000000000 --- a/tests/generated/preview1_fd_filestat_set.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_fd_filestat_set() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_fd_filestat_set"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_fd_filestat_set"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_fd_filestat_set --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_fd_flags_set.rs b/tests/generated/preview1_fd_flags_set.rs deleted file mode 100644 index 6d1990898..000000000 --- a/tests/generated/preview1_fd_flags_set.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_fd_flags_set() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_fd_flags_set"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_fd_flags_set"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_fd_flags_set --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_fd_readdir.rs b/tests/generated/preview1_fd_readdir.rs deleted file mode 100644 index bdd56e86c..000000000 --- a/tests/generated/preview1_fd_readdir.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_fd_readdir() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_fd_readdir"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_fd_readdir"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_fd_readdir --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_allocate.rs b/tests/generated/preview1_file_allocate.rs deleted file mode 100644 index a8ba2a443..000000000 --- a/tests/generated/preview1_file_allocate.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_allocate() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_allocate"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_allocate"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_allocate --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_pread_pwrite.rs b/tests/generated/preview1_file_pread_pwrite.rs deleted file mode 100644 index 3a0b69d39..000000000 --- a/tests/generated/preview1_file_pread_pwrite.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_pread_pwrite() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_pread_pwrite"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_pread_pwrite"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_pread_pwrite --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_seek_tell.rs b/tests/generated/preview1_file_seek_tell.rs deleted file mode 100644 index 049f14326..000000000 --- a/tests/generated/preview1_file_seek_tell.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_seek_tell() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_seek_tell"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_seek_tell"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_seek_tell --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_truncation.rs b/tests/generated/preview1_file_truncation.rs deleted file mode 100644 index 71b72c8dd..000000000 --- a/tests/generated/preview1_file_truncation.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_truncation() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_truncation"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_truncation"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_truncation --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_unbuffered_write.rs b/tests/generated/preview1_file_unbuffered_write.rs deleted file mode 100644 index 642677a70..000000000 --- a/tests/generated/preview1_file_unbuffered_write.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_unbuffered_write() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_unbuffered_write"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_unbuffered_write"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_unbuffered_write --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_file_write.rs b/tests/generated/preview1_file_write.rs deleted file mode 100644 index b6e8fc633..000000000 --- a/tests/generated/preview1_file_write.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_file_write() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_file_write"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_file_write"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_file_write --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_interesting_paths.rs b/tests/generated/preview1_interesting_paths.rs deleted file mode 100644 index 8dd19c495..000000000 --- a/tests/generated/preview1_interesting_paths.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_interesting_paths() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_interesting_paths"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_interesting_paths"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_interesting_paths --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_nofollow_errors.rs b/tests/generated/preview1_nofollow_errors.rs deleted file mode 100644 index 7641aaf53..000000000 --- a/tests/generated/preview1_nofollow_errors.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_nofollow_errors() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_nofollow_errors"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_nofollow_errors"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_nofollow_errors --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_overwrite_preopen.rs b/tests/generated/preview1_overwrite_preopen.rs deleted file mode 100644 index 3ec62c0a8..000000000 --- a/tests/generated/preview1_overwrite_preopen.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_overwrite_preopen() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_overwrite_preopen"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_overwrite_preopen"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_overwrite_preopen --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_exists.rs b/tests/generated/preview1_path_exists.rs deleted file mode 100644 index d7b7fae5a..000000000 --- a/tests/generated/preview1_path_exists.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_exists() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_exists"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_exists"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_exists --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_filestat.rs b/tests/generated/preview1_path_filestat.rs deleted file mode 100644 index 3b25537f0..000000000 --- a/tests/generated/preview1_path_filestat.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_filestat() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_filestat"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_filestat"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_filestat --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_link.rs b/tests/generated/preview1_path_link.rs deleted file mode 100644 index 177033fc4..000000000 --- a/tests/generated/preview1_path_link.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_link() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_link"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_link"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_link --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_create_existing.rs b/tests/generated/preview1_path_open_create_existing.rs deleted file mode 100644 index 23dde7107..000000000 --- a/tests/generated/preview1_path_open_create_existing.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_create_existing() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_open_create_existing"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_create_existing"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_create_existing --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_dirfd_not_dir.rs b/tests/generated/preview1_path_open_dirfd_not_dir.rs deleted file mode 100644 index df82f76dd..000000000 --- a/tests/generated/preview1_path_open_dirfd_not_dir.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_dirfd_not_dir() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_open_dirfd_not_dir"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_dirfd_not_dir"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_dirfd_not_dir --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_missing.rs b/tests/generated/preview1_path_open_missing.rs deleted file mode 100644 index 9ca0e97d9..000000000 --- a/tests/generated/preview1_path_open_missing.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_missing() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_open_missing"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_missing"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_missing --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_nonblock.rs b/tests/generated/preview1_path_open_nonblock.rs deleted file mode 100644 index a31c1396b..000000000 --- a/tests/generated/preview1_path_open_nonblock.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_nonblock() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_open_nonblock"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_nonblock"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_nonblock --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_preopen.rs b/tests/generated/preview1_path_open_preopen.rs deleted file mode 100644 index a79fe37c8..000000000 --- a/tests/generated/preview1_path_open_preopen.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_preopen() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_open_preopen"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_preopen"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_preopen --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_open_read_write.rs b/tests/generated/preview1_path_open_read_write.rs deleted file mode 100644 index d984108be..000000000 --- a/tests/generated/preview1_path_open_read_write.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -// use tempdir::TempDir; -// use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_open_read_write() -> anyhow::Result<()> { - // let sh = Shell::new()?; - // let file_name = "preview1_path_open_read_write"; - // let tempdir = TempDir::new("{file_name}")?; - // let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_open_read_write"); - - // let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_open_read_write --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - // let cmd = cmd.env("JCO_RUN_PATH", "deno").env("JCO_RUN_ARGS", "run --importmap importmap.json -A");cmd.run()?; - panic!("skipped"); // Ok(()) -} diff --git a/tests/generated/preview1_path_rename.rs b/tests/generated/preview1_path_rename.rs deleted file mode 100644 index 1513e5ab2..000000000 --- a/tests/generated/preview1_path_rename.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_rename() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_rename"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_rename"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_rename --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_rename_dir_trailing_slashes.rs b/tests/generated/preview1_path_rename_dir_trailing_slashes.rs deleted file mode 100644 index 9ea851cc0..000000000 --- a/tests/generated/preview1_path_rename_dir_trailing_slashes.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_rename_dir_trailing_slashes() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_rename_dir_trailing_slashes"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_rename_dir_trailing_slashes"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_rename_dir_trailing_slashes --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_path_symlink_trailing_slashes.rs b/tests/generated/preview1_path_symlink_trailing_slashes.rs deleted file mode 100644 index 5c3b44879..000000000 --- a/tests/generated/preview1_path_symlink_trailing_slashes.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_path_symlink_trailing_slashes() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_path_symlink_trailing_slashes"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_path_symlink_trailing_slashes"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_path_symlink_trailing_slashes --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_poll_oneoff_files.rs b/tests/generated/preview1_poll_oneoff_files.rs deleted file mode 100644 index 247c0197d..000000000 --- a/tests/generated/preview1_poll_oneoff_files.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_poll_oneoff_files() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_poll_oneoff_files"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_poll_oneoff_files"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_poll_oneoff_files --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_poll_oneoff_stdio.rs b/tests/generated/preview1_poll_oneoff_stdio.rs deleted file mode 100644 index 489990aed..000000000 --- a/tests/generated/preview1_poll_oneoff_stdio.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_poll_oneoff_stdio() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_poll_oneoff_stdio"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_poll_oneoff_stdio"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_poll_oneoff_stdio --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_readlink.rs b/tests/generated/preview1_readlink.rs deleted file mode 100644 index cf9856271..000000000 --- a/tests/generated/preview1_readlink.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_readlink() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_readlink"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_readlink"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_readlink --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_regular_file_isatty.rs b/tests/generated/preview1_regular_file_isatty.rs deleted file mode 100644 index 4e3b2f276..000000000 --- a/tests/generated/preview1_regular_file_isatty.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_regular_file_isatty() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_regular_file_isatty"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_regular_file_isatty"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_regular_file_isatty --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_remove_directory.rs b/tests/generated/preview1_remove_directory.rs deleted file mode 100644 index 9d7e73abf..000000000 --- a/tests/generated/preview1_remove_directory.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_remove_directory() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_remove_directory"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_remove_directory"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_remove_directory --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_remove_nonempty_directory.rs b/tests/generated/preview1_remove_nonempty_directory.rs deleted file mode 100644 index 2076f03c6..000000000 --- a/tests/generated/preview1_remove_nonempty_directory.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_remove_nonempty_directory() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_remove_nonempty_directory"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_remove_nonempty_directory"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_remove_nonempty_directory --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_renumber.rs b/tests/generated/preview1_renumber.rs deleted file mode 100644 index 93ed6ebc3..000000000 --- a/tests/generated/preview1_renumber.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_renumber() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_renumber"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_renumber"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_renumber --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_sched_yield.rs b/tests/generated/preview1_sched_yield.rs deleted file mode 100644 index 4db2f74f2..000000000 --- a/tests/generated/preview1_sched_yield.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_sched_yield() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_sched_yield"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_sched_yield"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_sched_yield --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_stdio.rs b/tests/generated/preview1_stdio.rs deleted file mode 100644 index 937cff175..000000000 --- a/tests/generated/preview1_stdio.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_stdio() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_stdio"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_stdio"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_stdio --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_stdio_isatty.rs b/tests/generated/preview1_stdio_isatty.rs deleted file mode 100644 index 4502e3bac..000000000 --- a/tests/generated/preview1_stdio_isatty.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_stdio_isatty() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_stdio_isatty"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_stdio_isatty"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_stdio_isatty --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_stdio_not_isatty.rs b/tests/generated/preview1_stdio_not_isatty.rs deleted file mode 100644 index 3c85bcd92..000000000 --- a/tests/generated/preview1_stdio_not_isatty.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_stdio_not_isatty() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_stdio_not_isatty"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_stdio_not_isatty"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_stdio_not_isatty --jco-import ./tests/virtualenvs/notty.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_symlink_create.rs b/tests/generated/preview1_symlink_create.rs deleted file mode 100644 index 937bfab82..000000000 --- a/tests/generated/preview1_symlink_create.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_symlink_create() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_symlink_create"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_symlink_create"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_symlink_create --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_symlink_filestat.rs b/tests/generated/preview1_symlink_filestat.rs deleted file mode 100644 index d7cc811bc..000000000 --- a/tests/generated/preview1_symlink_filestat.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_symlink_filestat() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_symlink_filestat"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_symlink_filestat"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_symlink_filestat --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_symlink_loop.rs b/tests/generated/preview1_symlink_loop.rs deleted file mode 100644 index c44c9c8dc..000000000 --- a/tests/generated/preview1_symlink_loop.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_symlink_loop() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_symlink_loop"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_symlink_loop"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_symlink_loop --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_unicode_output.rs b/tests/generated/preview1_unicode_output.rs deleted file mode 100644 index e3b2c7885..000000000 --- a/tests/generated/preview1_unicode_output.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_unicode_output() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_unicode_output"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_unicode_output"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_unicode_output --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview1_unlink_file_trailing_slashes.rs b/tests/generated/preview1_unlink_file_trailing_slashes.rs deleted file mode 100644 index ef29409b2..000000000 --- a/tests/generated/preview1_unlink_file_trailing_slashes.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview1_unlink_file_trailing_slashes() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview1_unlink_file_trailing_slashes"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview1_unlink_file_trailing_slashes"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview1_unlink_file_trailing_slashes --jco-import ./tests/virtualenvs/scratch.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_ip_name_lookup.rs b/tests/generated/preview2_ip_name_lookup.rs deleted file mode 100644 index 52c108071..000000000 --- a/tests/generated/preview2_ip_name_lookup.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_ip_name_lookup() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_ip_name_lookup"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_ip_name_lookup"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_ip_name_lookup --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_random.rs b/tests/generated/preview2_random.rs deleted file mode 100644 index 82dad2192..000000000 --- a/tests/generated/preview2_random.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_random() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_random"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_random"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_random --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_sleep.rs b/tests/generated/preview2_sleep.rs deleted file mode 100644 index 4bc10a036..000000000 --- a/tests/generated/preview2_sleep.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_sleep() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_sleep"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_sleep"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_sleep --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_stream_pollable_correct.rs b/tests/generated/preview2_stream_pollable_correct.rs deleted file mode 100644 index ba13434b7..000000000 --- a/tests/generated/preview2_stream_pollable_correct.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_stream_pollable_correct() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_stream_pollable_correct"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_stream_pollable_correct"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_stream_pollable_correct --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_stream_pollable_traps.rs b/tests/generated/preview2_stream_pollable_traps.rs deleted file mode 100644 index dc45a34cd..000000000 --- a/tests/generated/preview2_stream_pollable_traps.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_stream_pollable_traps() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_stream_pollable_traps"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_stream_pollable_traps"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_stream_pollable_traps --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run().expect_err("test should exit with code 1"); - Ok(()) -} diff --git a/tests/generated/preview2_tcp_bind.rs b/tests/generated/preview2_tcp_bind.rs deleted file mode 100644 index 228b83e73..000000000 --- a/tests/generated/preview2_tcp_bind.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_tcp_bind() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_tcp_bind"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_tcp_bind"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_tcp_bind --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_tcp_connect.rs b/tests/generated/preview2_tcp_connect.rs deleted file mode 100644 index 19c4a3ac6..000000000 --- a/tests/generated/preview2_tcp_connect.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_tcp_connect() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_tcp_connect"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_tcp_connect"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_tcp_connect --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_tcp_sample_application.rs b/tests/generated/preview2_tcp_sample_application.rs deleted file mode 100644 index 4600aa3fe..000000000 --- a/tests/generated/preview2_tcp_sample_application.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_tcp_sample_application() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_tcp_sample_application"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_tcp_sample_application"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_tcp_sample_application --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_tcp_sockopts.rs b/tests/generated/preview2_tcp_sockopts.rs deleted file mode 100644 index db6b71c3e..000000000 --- a/tests/generated/preview2_tcp_sockopts.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_tcp_sockopts() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_tcp_sockopts"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_tcp_sockopts"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_tcp_sockopts --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_tcp_states.rs b/tests/generated/preview2_tcp_states.rs deleted file mode 100644 index 9cf42a39f..000000000 --- a/tests/generated/preview2_tcp_states.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_tcp_states() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_tcp_states"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_tcp_states"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_tcp_states --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_udp_bind.rs b/tests/generated/preview2_udp_bind.rs deleted file mode 100644 index cefd152d1..000000000 --- a/tests/generated/preview2_udp_bind.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_udp_bind() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_udp_bind"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_udp_bind"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_udp_bind --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_udp_connect.rs b/tests/generated/preview2_udp_connect.rs deleted file mode 100644 index a522d322f..000000000 --- a/tests/generated/preview2_udp_connect.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_udp_connect() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_udp_connect"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_udp_connect"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_udp_connect --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_udp_sample_application.rs b/tests/generated/preview2_udp_sample_application.rs deleted file mode 100644 index 0d0bbfee5..000000000 --- a/tests/generated/preview2_udp_sample_application.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_udp_sample_application() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_udp_sample_application"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_udp_sample_application"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_udp_sample_application --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_udp_sockopts.rs b/tests/generated/preview2_udp_sockopts.rs deleted file mode 100644 index af349a590..000000000 --- a/tests/generated/preview2_udp_sockopts.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_udp_sockopts() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_udp_sockopts"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_udp_sockopts"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_udp_sockopts --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/tests/generated/preview2_udp_states.rs b/tests/generated/preview2_udp_states.rs deleted file mode 100644 index d44ca8552..000000000 --- a/tests/generated/preview2_udp_states.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! This file has been auto-generated, please do not modify manually -//! To regenerate this file re-run `cargo xtask generate tests` from the project root - -use std::fs; -use tempdir::TempDir; -use xshell::{cmd, Shell}; - -#[test] -fn preview2_udp_states() -> anyhow::Result<()> { - let sh = Shell::new()?; - let file_name = "preview2_udp_states"; - let tempdir = TempDir::new("{file_name}")?; - let wasi_file = test_utils::compile(&sh, &tempdir, &file_name)?; - let _ = fs::remove_dir_all("./tests/rundir/preview2_udp_states"); - - let cmd = cmd!(sh, "node ./src/jco.js run --jco-dir ./tests/rundir/preview2_udp_states --jco-import ./tests/virtualenvs/base.js {wasi_file} hello this '' 'is an argument' 'with 🚩 emoji'"); - - let cmd = cmd - .env("JCO_RUN_PATH", "deno") - .env("JCO_RUN_ARGS", "run --importmap importmap.json -A"); - cmd.run()?; - Ok(()) -} diff --git a/xtask/src/generate/preview2_tests.rs b/xtask/src/generate/preview2_tests.rs index 92f704d51..bfabca0c6 100644 --- a/xtask/src/generate/preview2_tests.rs +++ b/xtask/src/generate/preview2_tests.rs @@ -12,6 +12,9 @@ const TEST_IGNORE: &[&str] = &[ "cli_argv0", // We don't have interrupts. "cli_sleep_forever", + // Don't currently support WASI config store. + "config_get", + "cli_serve_config", ]; // we don't currently support these subsystems, but if someone wants to work on them we @@ -26,6 +29,7 @@ const DENO_IGNORE: &[&str] = &[ "cli_file_read", "cli_splice_stdin", "cli_stdin", + "cli_stdin_empty", "cli_stdio_write_flushes", "http_outbound_request_get", "http_outbound_request_invalid_dnsname", @@ -204,6 +208,7 @@ fn generate_test(test_name: &str, windows_skip: bool, deno: bool) -> String { let should_error = match test_name { "cli_exit_failure" + | "cli_exit_with_code" | "cli_exit_panic" | "preview2_stream_pollable_traps" | "preview2_pollable_traps" => true,