Fix tests for wasm32-unknown-unknown

This commit is contained in:
Emilia Allison 2023-05-26 16:20:52 -04:00
parent ebb8bf70af
commit 855506bd26
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
6 changed files with 74 additions and 114 deletions

162
Cargo.lock generated
View File

@ -29,8 +29,8 @@ version = "0.1.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -61,12 +61,6 @@ version = "3.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -79,7 +73,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"wasm-bindgen",
]
@ -101,8 +95,8 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
dependencies = [
"fnv",
"ident_case",
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"strsim",
"syn 1.0.109",
]
@ -114,7 +108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
dependencies = [
"darling_core",
"quote 1.0.27",
"quote",
"syn 1.0.109",
]
@ -133,12 +127,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "futures"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678"
[[package]]
name = "futures"
version = "0.3.28"
@ -181,8 +169,8 @@ version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -222,7 +210,7 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"js-sys",
"libc",
"wasi",
@ -325,7 +313,7 @@ dependencies = [
"serde_json",
"thiserror",
"wasm-bindgen",
"wasm-bindgen-futures 0.4.36",
"wasm-bindgen-futures",
"web-sys",
]
@ -390,7 +378,7 @@ dependencies = [
"js-sys",
"serde",
"wasm-bindgen",
"wasm-bindgen-futures 0.4.36",
"wasm-bindgen-futures",
"web-sys",
]
@ -467,7 +455,7 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
@ -513,8 +501,8 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -536,7 +524,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b"
dependencies = [
"futures 0.3.28",
"futures",
"rustversion",
"thiserror",
]
@ -570,7 +558,7 @@ version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86"
dependencies = [
"proc-macro2 1.0.58",
"proc-macro2",
"syn 1.0.109",
]
@ -581,8 +569,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 1.0.109",
"version_check",
]
@ -593,20 +581,11 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro2"
version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
dependencies = [
"unicode-xid",
]
[[package]]
name = "proc-macro2"
version = "1.0.58"
@ -622,7 +601,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488"
dependencies = [
"futures 0.3.28",
"futures",
"gloo",
"num_cpus",
"once_cell",
@ -630,16 +609,7 @@ dependencies = [
"pinned",
"tokio",
"tokio-stream",
"wasm-bindgen-futures 0.4.36",
]
[[package]]
name = "quote"
version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
dependencies = [
"proc-macro2 0.4.30",
"wasm-bindgen-futures",
]
[[package]]
@ -648,7 +618,7 @@ version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
dependencies = [
"proc-macro2 1.0.58",
"proc-macro2",
]
[[package]]
@ -742,8 +712,8 @@ version = "1.0.163"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -791,8 +761,8 @@ version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"unicode-ident",
]
@ -802,8 +772,8 @@ version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"unicode-ident",
]
@ -822,8 +792,8 @@ version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -855,7 +825,7 @@ version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@ -867,8 +837,8 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -887,12 +857,6 @@ version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
[[package]]
name = "uuid"
version = "1.3.3"
@ -912,8 +876,8 @@ version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f67b459f42af2e6e1ee213cb9da4dbd022d3320788c3fb3e1b893093f1e45da"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
]
@ -935,7 +899,7 @@ version = "0.2.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"wasm-bindgen-macro",
]
@ -948,32 +912,19 @@ dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c"
dependencies = [
"cfg-if 0.1.10",
"futures 0.1.31",
"js-sys",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
@ -985,7 +936,7 @@ version = "0.2.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
dependencies = [
"quote 1.0.27",
"quote",
"wasm-bindgen-macro-support",
]
@ -995,8 +946,8 @@ version = "0.2.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
dependencies = [
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 2.0.16",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
@ -1010,27 +961,26 @@ checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
[[package]]
name = "wasm-bindgen-test"
version = "0.2.50"
version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2d9693b63a742d481c7f80587e057920e568317b2806988c59cd71618bc26c1"
checksum = "c9e636f3a428ff62b3742ebc3c70e254dfe12b8c2b469d688ea59cdd4abcf502"
dependencies = [
"console_error_panic_hook",
"futures 0.1.31",
"js-sys",
"scoped-tls",
"wasm-bindgen",
"wasm-bindgen-futures 0.3.27",
"wasm-bindgen-futures",
"wasm-bindgen-test-macro",
]
[[package]]
name = "wasm-bindgen-test-macro"
version = "0.2.50"
version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0789dac148a8840bbcf9efe13905463b733fa96543bfbf263790535c11af7ba5"
checksum = "f18c1fad2f7c4958e7bcce014fa212f59a65d5e3721d0f77e6c0b27ede936ba3"
dependencies = [
"proc-macro2 0.4.30",
"quote 0.6.13",
"proc-macro2",
"quote",
]
[[package]]
@ -1127,7 +1077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc"
dependencies = [
"console_error_panic_hook",
"futures 0.3.28",
"futures",
"gloo",
"implicit-clone",
"indexmap",
@ -1140,7 +1090,7 @@ dependencies = [
"tokio",
"tracing",
"wasm-bindgen",
"wasm-bindgen-futures 0.4.36",
"wasm-bindgen-futures",
"web-sys",
"yew-macro",
]
@ -1155,8 +1105,8 @@ dependencies = [
"once_cell",
"prettyplease",
"proc-macro-error",
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 1.0.109",
]
@ -1187,7 +1137,7 @@ checksum = "25bcd923aceaa85cb4affad8657cc36e3d6b6932740e711574182f7817492739"
dependencies = [
"darling",
"proc-macro-error",
"proc-macro2 1.0.58",
"quote 1.0.27",
"proc-macro2",
"quote",
"syn 1.0.109",
]

View File

@ -18,4 +18,4 @@ uuid = { version = "1.3", features = ["v4", "fast-rng", "macro-diagnostics", "js
serde = { version = "1.0", features = ["derive"] }
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3.0"

View File

@ -164,10 +164,13 @@ pub fn in_rect(corner1: Option<(u8, u8)>, corner2: Option<(u8, u8)>, pt: (u8, u8
#[cfg(test)]
mod tests {
use wasm_bindgen_test::*;
use super::in_rect;
// in_rect tests
#[test]
#[wasm_bindgen_test]
fn test_in_rect1() {
// Test in center of rect
let c1 = (1, 1);
@ -179,6 +182,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_in_rect2() {
// Test on top/bottom edges of rect
let c1 = (1, 1);
@ -193,6 +197,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_in_rect3() {
// Test on left/right edges of rect
let c1 = (1, 1);
@ -207,6 +212,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_in_rect4() {
// Test cases that should fail
let c1 = (1, 1);

View File

@ -256,9 +256,12 @@ fn num_to_letters(num: u8) -> Option<String> {
#[cfg(test)]
mod tests {
use wasm_bindgen_test::*;
use super::{letters_to_num, num_to_letters, RegionDisplay};
#[test]
#[wasm_bindgen_test]
fn test_letters_to_num() {
assert_eq!(letters_to_num("D"), Some(4));
assert_eq!(letters_to_num("d"), None);
@ -267,6 +270,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_num_to_letters() {
println!("27 is {:?}", num_to_letters(27));
assert_eq!(num_to_letters(1), Some("A".to_string()));
@ -276,6 +280,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_l2n_and_n2l() {
assert_eq!(num_to_letters(letters_to_num("A").unwrap()), Some("A".to_string()));
assert_eq!(num_to_letters(letters_to_num("BJ").unwrap()), Some("BJ".to_string()));
@ -285,6 +290,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_try_from_string_for_regiondisplay() {
let desired = RegionDisplay {
text: "A1:E5".to_string(),

View File

@ -87,10 +87,3 @@ impl PlateFormat {
}
}
}
/*
#[cfg(test)]
mod tests {
use super::{Plate, PlateFormat, PlateType};
}
*/

View File

@ -368,10 +368,13 @@ impl fmt::Display for TransferRegion {
#[cfg(test)]
mod tests {
use wasm_bindgen_test::*;
use crate::data::plate::*;
use crate::data::transfer_region::*;
#[test]
#[wasm_bindgen_test]
fn test_simple_transfer() {
let source = Plate::new(PlateType::Source, PlateFormat::W96);
let destination = Plate::new(PlateType::Destination, PlateFormat::W384);
@ -419,6 +422,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_replicate_transfer() {
let source = Plate::new(PlateType::Source, PlateFormat::W96);
let destination = Plate::new(PlateType::Destination, PlateFormat::W384);
@ -437,6 +441,7 @@ mod tests {
}
#[test]
#[wasm_bindgen_test]
fn test_pooling_transfer() {
}
}