diff --git a/.github/workflows/build-ffi.yml b/.github/workflows/build-ffi.yml index 3afe9d000..5428365e3 100644 --- a/.github/workflows/build-ffi.yml +++ b/.github/workflows/build-ffi.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-12 ] + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] rust: [ stable ] env: pact_do_not_track: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6d9d92a9..cfa567238 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,8 +6,9 @@ jobs: build: runs-on: ${{ matrix.operating-system }} strategy: + fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-12 ] + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] rust: [ stable ] env: pact_do_not_track: true diff --git a/.github/workflows/compatability-suite.yml b/.github/workflows/compatability-suite.yml index 75b6b632b..d5940a6d8 100644 --- a/.github/workflows/compatability-suite.yml +++ b/.github/workflows/compatability-suite.yml @@ -7,7 +7,11 @@ env: jobs: v1: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -15,7 +19,11 @@ jobs: run: cargo test --test v1* working-directory: compatibility-suite v2: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -23,7 +31,11 @@ jobs: run: cargo test --test v2* working-directory: compatibility-suite v3: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -31,7 +43,11 @@ jobs: run: cargo test --test v3* working-directory: compatibility-suite v4: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-latest, windows-latest, macos-12, macos-14 ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable diff --git a/compatibility-suite/Cargo.lock b/compatibility-suite/Cargo.lock index ba7f6b2a2..3a22fcfb0 100644 --- a/compatibility-suite/Cargo.lock +++ b/compatibility-suite/Cargo.lock @@ -379,6 +379,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -491,8 +502,8 @@ dependencies = [ "lazy_static", "maplit", "pact_consumer", - "pact_matching", - "pact_mock_server", + "pact_matching 1.2.3", + "pact_mock_server 1.2.7", "pact_models", "pact_verifier", "pretty_assertions", @@ -1449,6 +1460,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "infer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +dependencies = [ + "cfb", +] + [[package]] name = "inflections" version = "1.1.1" @@ -1984,8 +2004,8 @@ dependencies = [ "lazy_static", "maplit", "pact-plugin-driver", - "pact_matching", - "pact_mock_server", + "pact_matching 1.2.3", + "pact_mock_server 1.2.8", "pact_models", "regex", "serde_json", @@ -2009,6 +2029,47 @@ dependencies = [ "futures", "hex", "http 1.1.0", + "infer", + "itertools 0.12.1", + "lazy_static", + "lenient_semver", + "maplit", + "md5", + "mime", + "multer 3.1.0", + "nom", + "onig", + "pact-plugin-driver", + "pact_models", + "rand", + "reqwest 0.12.4", + "semver", + "serde", + "serde_json", + "serde_urlencoded", + "sxd-document", + "tokio", + "tracing", + "tracing-core", + "tree_magic_mini", + "uuid", +] + +[[package]] +name = "pact_matching" +version = "1.2.3" +source = "git+https://github.com/you54f/pact-reference.git?branch=master#5e363b9447e4b929fe3614940f23a6a8fd556310" +dependencies = [ + "ansi_term", + "anyhow", + "base64 0.22.1", + "bytes", + "chrono", + "difference", + "futures", + "hex", + "http 1.1.0", + "infer", "itertools 0.12.1", "lazy_static", "lenient_semver", @@ -2049,7 +2110,36 @@ dependencies = [ "lazy_static", "maplit", "pact-plugin-driver", - "pact_matching", + "pact_matching 1.2.3", + "pact_models", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-rustls 0.24.1", + "tracing", + "tracing-core", + "url", + "uuid", +] + +[[package]] +name = "pact_mock_server" +version = "1.2.8" +source = "git+https://github.com/you54f/pact-core-mock-server.git?branch=main#090eb1ab3d6d201247cb016b57269f390a37e830" +dependencies = [ + "anyhow", + "bytes", + "futures", + "hyper 0.14.28", + "hyper-rustls 0.24.2", + "itertools 0.12.1", + "lazy_static", + "maplit", + "pact-plugin-driver", + "pact_matching 1.2.3 (git+https://github.com/you54f/pact-reference.git?branch=master)", "pact_models", "rustls 0.21.12", "rustls-pemfile 1.0.4", @@ -2121,7 +2211,7 @@ dependencies = [ "maplit", "mime", "pact-plugin-driver", - "pact_matching", + "pact_matching 1.2.3", "pact_models", "regex", "reqwest 0.12.4", @@ -3695,9 +3785,9 @@ dependencies = [ [[package]] name = "tree_magic_mini" -version = "3.1.4" +version = "3.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ee137597cdb361b55a4746983e4ac1b35ab6024396a419944ad473bb915265" +checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" dependencies = [ "fnv", "home", diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 197c5f9f7..d5845c101 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -112,9 +112,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "ariadne" @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9eabd7a98fe442131a17c316bd9349c43695e49e730c3c8e12cfb5f4da2693" +checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" dependencies = [ "flate2", "futures-core", @@ -156,9 +156,9 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -167,9 +167,9 @@ version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -189,6 +189,17 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "automod" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" +dependencies = [ + "proc-macro2 1.0.84", + "quote 1.0.36", + "syn 2.0.66", +] + [[package]] name = "axum" version = "0.6.20" @@ -236,9 +247,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -338,15 +349,26 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", "once_cell", ] +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -525,9 +547,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -553,9 +575,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -569,9 +591,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -579,27 +601,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "strsim 0.10.0", - "syn 2.0.61", + "strsim 0.11.1", + "syn 2.0.66", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -618,7 +640,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2c35ab6e03642397cdda1dd58abbc05d418aef8e36297f336d5aba060fe8df" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "syn 1.0.109", ] @@ -654,9 +676,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encode_unicode" @@ -844,9 +866,9 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -917,9 +939,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -1205,9 +1227,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", @@ -1303,6 +1325,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "infer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +dependencies = [ + "cfb", +] + [[package]] name = "inout" version = "0.1.3" @@ -1314,9 +1345,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1424,15 +1455,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -1467,10 +1498,10 @@ checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" dependencies = [ "beef", "fnv", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "regex-syntax 0.6.29", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -1539,9 +1570,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -1636,7 +1667,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "197eff6c12b80ff5de6173e438fa3c1340a9e708118c1626e690f65aee1e5332" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "syn 1.0.109", ] @@ -1648,7 +1679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef492b5cf80f90c050b287e747228a1fa6517e9d754f364b5a7e0e038e49a25f" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "syn 1.0.109", ] @@ -1763,9 +1794,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -2014,6 +2045,7 @@ dependencies = [ "hamcrest2", "hex", "http 1.1.0", + "infer", "itertools 0.12.1", "lazy_static", "lenient_semver", @@ -2236,9 +2268,9 @@ checksum = "384e52fd8fbd4cbe3c317e8216260c21a0f9134de108cea8a4dd4e7e152c472d" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2364,9 +2396,9 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -2421,8 +2453,8 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ - "proc-macro2 1.0.82", - "syn 2.0.61", + "proc-macro2 1.0.84", + "syn 2.0.66", ] [[package]] @@ -2445,18 +2477,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -2464,9 +2496,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck", @@ -2479,28 +2511,28 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.61", + "syn 2.0.66", "tempfile", ] [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools 0.12.1", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] @@ -2540,7 +2572,7 @@ version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", ] [[package]] @@ -2792,12 +2824,12 @@ checksum = "04a9df72cc1f67020b0d63ad9bfe4a323e459ea7eb68e03bd9824db49f9a4c25" dependencies = [ "cfg-if", "glob", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "regex", "relative-path", "rustc_version", - "syn 2.0.61", + "syn 2.0.66", "unicode-ident", ] @@ -2850,7 +2882,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -2917,9 +2949,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -2928,9 +2960,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" @@ -3003,22 +3035,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3034,9 +3066,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -3078,9 +3110,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3158,9 +3190,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snapbox" -version = "0.5.9" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac441e1ecf678f68423d47f376d53fabce1afba92c8f68e31508eb27df8562a" +checksum = "94204b12a4d3550420babdb4148c6639692e4e3e61060866929c5107f208aeb6" dependencies = [ "anstream", "anstyle", @@ -3180,9 +3212,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" +checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d" dependencies = [ "anstream", ] @@ -3230,12 +3262,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -3275,18 +3301,18 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.61" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", "unicode-ident", ] @@ -3373,9 +3399,9 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3389,22 +3415,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3498,9 +3524,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3563,21 +3589,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -3595,15 +3621,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.9", ] [[package]] @@ -3640,10 +3666,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" dependencies = [ "prettyplease", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "prost-build", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3696,9 +3722,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3742,9 +3768,9 @@ dependencies = [ [[package]] name = "tree_magic_mini" -version = "3.1.4" +version = "3.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ee137597cdb361b55a4746983e4ac1b35ab6024396a419944ad473bb915265" +checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" dependencies = [ "fnv", "home", @@ -3768,10 +3794,11 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trycmd" -version = "0.15.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14c6930faf7c6c4942ce17daa6f38d659d2ebf2b579a56b6926707038eb37b0" +checksum = "59709bd8eccada6a3fded26d22a7f2dcee406c18d3bd7ad2605ca3eeb8f6f6ec" dependencies = [ + "automod", "glob", "humantime", "humantime-serde", @@ -3779,7 +3806,7 @@ dependencies = [ "serde", "shlex", "snapbox", - "toml_edit 0.22.12", + "toml_edit 0.22.13", ] [[package]] @@ -3908,7 +3935,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", ] @@ -3965,9 +3992,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -3999,9 +4026,9 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ - "proc-macro2 1.0.82", + "proc-macro2 1.0.84", "quote 1.0.36", - "syn 2.0.61", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4235,9 +4262,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" dependencies = [ "memchr", ] @@ -4281,9 +4308,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zip" diff --git a/rust/pact_consumer/Cargo.toml b/rust/pact_consumer/Cargo.toml index b27700802..2d23c8617 100644 --- a/rust/pact_consumer/Cargo.toml +++ b/rust/pact_consumer/Cargo.toml @@ -30,7 +30,7 @@ itertools = "0.12.1" lazy_static = "1.4.0" maplit = "1.0.2" pact_matching = { version = "~1.2.2", path = "../pact_matching", default-features = false } -pact_mock_server = { version = "~1.2.6", default-features = false } +pact_mock_server = { version = "~1.2.7", default-features = false } pact_models = { version = "~1.2.0", default-features = false } pact-plugin-driver = { version = "~0.6.1", optional = true, default-features = false } regex = "1.10.4" diff --git a/rust/pact_ffi/Cargo.toml b/rust/pact_ffi/Cargo.toml index ee3ef36c9..b3a52a36a 100644 --- a/rust/pact_ffi/Cargo.toml +++ b/rust/pact_ffi/Cargo.toml @@ -31,7 +31,7 @@ maplit = "1.0.2" multipart = { version = "0.18.0", default-features = false, features = ["client", "mock"] } onig = { version = "6.4.0", default-features = false } pact_matching = { version = "~1.2.2", path = "../pact_matching" } -pact_mock_server = { version = "~1.2.6" } +pact_mock_server = { version = "~1.2.7" } pact_models = { version = "~1.2.0" } pact-plugin-driver = { version = "~0.6.1" } pact_verifier = { version = "~1.2.1", path = "../pact_verifier" } diff --git a/rust/pact_ffi/src/matching.rs b/rust/pact_ffi/src/matching.rs index b56841d9a..385f16923 100644 --- a/rust/pact_ffi/src/matching.rs +++ b/rust/pact_ffi/src/matching.rs @@ -350,7 +350,6 @@ mod tests { ]; #[test_log::test] - #[cfg(not(windows))] fn pactffi_matches_binary_value_test() { let rule = MatchingRule::ContentType("image/gif".to_string()); let rule_ptr = &rule as *const MatchingRule; @@ -363,6 +362,7 @@ mod tests { let rule_ptr = &rule as *const MatchingRule; let err_result = pactffi_matches_binary_value(rule_ptr, value, 35, value, 35, 0); let string = unsafe { CString::from_raw(err_result as *mut c_char) }; + expect!(string.to_string_lossy()).to(be_equal_to("Expected binary contents to have content type 'image/png' but detected contents was 'image/gif'")); } diff --git a/rust/pact_ffi/tests/tests.rs b/rust/pact_ffi/tests/tests.rs index 7f7d25e48..1f0ce774d 100644 --- a/rust/pact_ffi/tests/tests.rs +++ b/rust/pact_ffi/tests/tests.rs @@ -641,7 +641,6 @@ fn fixture_path(path: &str) -> PathBuf { .to_owned() } -#[cfg(not(windows))] #[rstest( specification, expected_value, case::specification_unknown(PactSpecification::Unknown, false), @@ -695,6 +694,7 @@ fn pactffi_with_binary_file_feature_test(specification: PactSpecification, expec CStr::from_ptr(pactffi_mock_server_mismatches(port)).to_string_lossy().into_owned() }; + println!("pactffi_with_binary_file_feature_test v{}: {}", specification, mismatches); match result { Ok(res) => { let status = res.status(); diff --git a/rust/pact_matching/Cargo.toml b/rust/pact_matching/Cargo.toml index 2c7125a69..a9f4d1e02 100644 --- a/rust/pact_matching/Cargo.toml +++ b/rust/pact_matching/Cargo.toml @@ -52,7 +52,8 @@ sxd-document = { version = "0.3.2", optional = true } tokio = { version = "1.37.0", features = ["full"] } tracing = "0.1.40" tracing-core = "0.1.32" -tree_magic_mini = "3.1.4" +infer = "0.15.0" +tree_magic_mini = "3.1.5" uuid = { version = "1.8.0", features = ["v4"] } [dev-dependencies] diff --git a/rust/pact_matching/README.md b/rust/pact_matching/README.md index 1f0646d80..8b432b7ad 100644 --- a/rust/pact_matching/README.md +++ b/rust/pact_matching/README.md @@ -510,6 +510,27 @@ Example: matching(contentType, 'application/json', '{}') ``` +###### Content Type - Detection Mechanisms for Binary Content + +`pact_matching` currently performs the following for matching Binary content-types + +1. Determines `expected` `Content-Type` header requested by user in test +2. Read content buffer with `infer` library, and guess `Content-Type` based on magic bytes +3. If unsuccessful + 1. Read content buffer with `tree_magic_mini` library, and guess `Content-Type` based on shared-mime-info DB + 1. MagicDB is not shipped with pact_matching, due to GPL restrictions, users can add manually + 1. Linux Alpine - `apk add shared-mime-info` + 2. MacOS `brew install shared-mime-info` + 1. `arm64` MacOS requires `tree_magic_mini` [fork](https://github.com/you54f/tree_magic) + 3. Linux - Debian`apt-get install -y shared-mime-info` +4. If either result returns `text/plain`, then manually read bytes using `detect_content_type_from_bytes` function in `pact_models` +5. If all of `2`, `3`, or `4` fails, then throw error, otherwise return `Ok` + +Rust libraries used: + +- https://github.com/mbrubeck/tree_magic +- https://github.com/bojand/infer + ##### Matching an example type by reference Type matching can also be specified by a reference to an example. References are defined by a dollar (`$`) followed by diff --git a/rust/pact_matching/src/binary_utils.rs b/rust/pact_matching/src/binary_utils.rs index a85890500..7f117bbb2 100644 --- a/rust/pact_matching/src/binary_utils.rs +++ b/rust/pact_matching/src/binary_utils.rs @@ -35,23 +35,79 @@ use crate::matchers::Matches; /// Compares the binary data using a magic test and comparing the resulting detected content /// type against the expected content type pub fn match_content_type(data: &[u8], expected_content_type: S) -> anyhow::Result<()> - where S: Into { - let result = tree_magic_mini::from_u8(data); +where + S: Into, +{ let expected = expected_content_type.into(); - let matches = result == expected; - debug!("Matching binary contents by content type: expected '{}', detected '{}' -> {}", - expected, result, matches); - if matches { - Ok(()) - } else if result == "text/plain" { - detect_content_type_from_bytes(data) - .and_then(|ct| if ct == ContentType::from(&expected) { Some(()) } else { None }) - .ok_or_else(|| anyhow!("Expected binary contents to have content type '{}' but detected contents was '{}'", - expected, result)) - } else { - Err(anyhow!("Expected binary contents to have content type '{}' but detected contents was '{}'", - expected, result)) + + // Use infer crate to detect via magic bytes + let inferred_content_type = infer::get(data) + .map(|result| result.mime_type()) + .unwrap_or_default(); + let inferred_match = inferred_content_type == expected; + debug!("Matching binary contents by content type: expected '{}', detection method: infer '{}' -> {}", + expected, inferred_content_type, inferred_match); + if inferred_match { + return Ok(()); } + + let mut magic_content_type = ""; + let mut magic_match = false; + if inferred_content_type == "" { + // Use tree_magic_mini crate to detect via magic bytes using mime-db (requires user to install) + magic_content_type = tree_magic_mini::from_u8(data); + magic_match = magic_content_type == expected; + debug!("Matching binary contents by content type: expected '{}', detection method: tree_magic_mini '{}' -> {}", + expected, magic_content_type, magic_match); + if magic_match { + return Ok(()); + } + } + + // Where we have detected text/plain, check content type against our own detection from bytes + let detected_content_type: &str = { + if inferred_content_type != "" { + inferred_content_type + } else { + magic_content_type + } + }; + + let matched: bool = magic_match || inferred_match; + if matched { + return Ok(()); + }; + let unmatched = !magic_match && !inferred_match; + let detected_text_plain = detected_content_type == "text/plain"; + + if unmatched && detected_text_plain { + debug!("Matching binary contents by content type: expected '{}', detected '{}', matched: {}. Attempting to detect_content_type_from_bytes", + expected, detected_content_type, unmatched); + let bytes_detected_content_type = detect_content_type_from_bytes(data) + .ok_or_else(|| anyhow!( + "Expected binary contents to have content type '{}' but detected contents was '{}'", + expected, + detected_content_type + ))?; + let bytes_match = bytes_detected_content_type == ContentType::from(&expected); + debug!("Matching binary contents by content type: expected '{}', detection method: detect_content_type_from_bytes '{}' -> {}", + expected, bytes_detected_content_type, bytes_match); + return if bytes_match { + Ok(()) + } else { + Err(anyhow!( + "Expected binary contents to have content type '{}' but detected contents was '{}'", + expected, + bytes_detected_content_type + )) + }; + } + + Err(anyhow!( + "Expected binary contents to have content type '{}' but detected contents was '{}'", + expected, + detected_content_type + )) } pub(crate) fn convert_data(data: &Value) -> Vec { @@ -1027,7 +1083,6 @@ mod tests { #[test] #[cfg(feature = "multipart")] - #[cfg(not(target_os = "windows"))] // Requires shared mime-info db, not available on Windows fn match_mime_multipart_content_type_matcher() { let expected_body = Bytes::from("--1234\r\n\ Content-Type: text/plain\r\n\ @@ -1084,7 +1139,6 @@ mod tests { #[test] #[cfg(feature = "multipart")] - #[cfg(not(target_os = "windows"))] // Requires shared mime-info db, not available on Windows fn match_mime_multipart_content_type_matcher_with_mismatch() { let expected_body = Bytes::from("--1234\r\n\ Content-Type: text/plain\r\n\ @@ -1138,7 +1192,6 @@ mod tests { #[test] #[cfg(feature = "multipart")] - #[cfg(not(target_os = "windows"))] // Requires shared mime-info db, not available on Windows fn match_content_type_equals() { expect!(match_content_type("some text".as_bytes(), "text/plain")).to(be_ok()); @@ -1151,7 +1204,6 @@ mod tests { #[test] #[cfg(feature = "multipart")] - #[cfg(not(target_os = "windows"))] // Requires shared mime-info db, not available on Windows fn match_content_type_common_text_types() { expect!(match_content_type("{\"val\": \"some text\"}".as_bytes(), "application/json")).to(be_ok()); expect!(match_content_type("".as_bytes(), "application/xml")).to(be_ok()); diff --git a/rust/pact_matching/src/json.rs b/rust/pact_matching/src/json.rs index 07e21151b..1a57a64de 100644 --- a/rust/pact_matching/src/json.rs +++ b/rust/pact_matching/src/json.rs @@ -977,7 +977,6 @@ mod tests { expect!(Value::String("plain text".into()).matches_with(&Value::String("different text".into()), &matcher, false)).to(be_ok()); expect!(Value::String("plain text".into()).matches_with(&json!(100), &matcher, false)).to(be_ok()); expect!(Value::String("plain text".into()).matches_with(&json!(100.01), &matcher, false)).to(be_ok()); - #[cfg(not(windows))] { let xml = r#" diff --git a/rust/pact_matching/src/matchers.rs b/rust/pact_matching/src/matchers.rs index a1f9150ec..c3e759f69 100644 --- a/rust/pact_matching/src/matchers.rs +++ b/rust/pact_matching/src/matchers.rs @@ -1238,7 +1238,6 @@ mod tests { expect!("plain text".matches_with("plain text", &matcher, false)).to(be_ok()); expect!("plain text".matches_with("different text", &matcher, false)).to(be_ok()); expect!("plain text".matches_with(100, &matcher, false)).to(be_err()); - #[cfg(not(windows))] { let xml = r#" diff --git a/rust/pact_matching/src/tests.rs b/rust/pact_matching/src/tests.rs index a881cfa6c..f6b9f5461 100644 --- a/rust/pact_matching/src/tests.rs +++ b/rust/pact_matching/src/tests.rs @@ -878,7 +878,6 @@ fn values_matcher_defined() { const IMAGE_BYTES: [u8; 16] = [ 0o107, 0o111, 0o106, 0o070, 0o067, 0o141, 0o001, 0o000, 0o001, 0o000, 0o200, 0o000, 0o000, 0o377, 0o377, 0o377 ]; -#[cfg(not(windows))] #[test] fn compare_bodies_core_should_check_for_content_type_matcher() { let content_type = ContentType::parse("application/gif").unwrap(); diff --git a/rust/pact_models/src/v4/http_parts.rs b/rust/pact_models/src/v4/http_parts.rs index 6128d6301..55992979a 100644 --- a/rust/pact_models/src/v4/http_parts.rs +++ b/rust/pact_models/src/v4/http_parts.rs @@ -344,6 +344,7 @@ pub fn body_from_json(json: &Value, attr_name: &str, headers: &Option