Skip to content

Commit

Permalink
Add tests for tesaguri#9
Browse files Browse the repository at this point in the history
  • Loading branch information
tesaguri committed Oct 6, 2021
1 parent b6302a9 commit 0da62e4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.wasm32-unknown-unknown]
runner = "wasm-bindgen-test-runner"
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,40 @@ jobs:
- beta
- nightly
- '1.46.0'
target:
-
features:
-
- derive
- hmac-sha1
include:
- features: ''
target: wasm32-unknown-unknown
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
profile: minimal
override: true
id: toolchain
- uses: Swatinem/rust-cache@v1
- name: Install `wasm-bindgen-test-runner`
if: matrix.target == 'wasm32-unknown-unknown'
run: |
VER=0.2.78
NAME="wasm-bindgen-$VER-x86_64-unknown-linux-musl"
DIGEST=14f1b0ef9225370f0d270efbdbbfe2cf5eb191d57b8eec14ade69c98c71e226f
curl -fLOsS "https://github.com/rustwasm/wasm-bindgen/releases/download/$VER/$NAME.tar.gz"
sha256sum --check --quiet <<< "$DIGEST $NAME.tar.gz"
tar -xzf "$NAME.tar.gz" "$NAME/wasm-bindgen-test-runner"
mv "$NAME/wasm-bindgen-test-runner" /usr/local/bin/
- run: echo 'RUSTFLAGS=--allow unknown_lints' >> $GITHUB_ENV
if: matrix.toolchain == '1.46.0'
- run: echo 'CARGO_BUILD_TARGET=${{ matrix.target }}' >> $GITHUB_ENV
if: matrix.target != ''
- name: Build `oauth1-request`
uses: actions-rs/cargo@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions oauth1-request/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ version-sync = "0.9"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
js-sys = "0.3"

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
getrandom = { version = "0.2", features = ["js"] }
wasm-bindgen-test = "0.3"

[features]
default = ["derive", "hmac-sha1"]
derive = ["oauth1-request-derive"]
Expand Down
14 changes: 14 additions & 0 deletions oauth1-request/tests/pull_9.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//! Test for <https://github.com/tesaguri/oauth1-request-rs/pull/9>.
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
use wasm_bindgen_test::wasm_bindgen_test as test;

#[test]
fn pull_9() {
let _ = oauth1_request::get(
"",
&(),
&oauth_credentials::Token::from_parts("", "", "", ""),
oauth1_request::HmacSha1,
);
}

0 comments on commit 0da62e4

Please sign in to comment.