Skip to content

Commit

Permalink
chore: Add WASM test coverage for SigningAlg tests (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten-adobe authored Nov 22, 2024
1 parent 2df2f1d commit 2a41ee5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/crypto/src/tests/signing_alg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
// specific language governing permissions and limitations under
// each license.

#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test;

use crate::signing_alg::{SigningAlg, UnknownAlgorithmError};

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn alg_from_str() {
assert_eq!("es256".parse(), Ok(SigningAlg::Es256));
assert_eq!("es384".parse(), Ok(SigningAlg::Es384));
Expand All @@ -28,6 +32,7 @@ fn alg_from_str() {
}

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn signing_alg_impl_display() {
assert_eq!(format!("{}", SigningAlg::Es256), "es256");
assert_eq!(format!("{}", SigningAlg::Es384), "es384");
Expand All @@ -39,6 +44,7 @@ fn signing_alg_impl_display() {
}

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn err_impl_display() {
assert_eq!(
format!("{}", UnknownAlgorithmError("bogus".to_owned())),
Expand Down

0 comments on commit 2a41ee5

Please sign in to comment.