feat: added support to wasm (#94)

* test: run tests also in wasm targets

* fix: install rand with wasm-bindgen por wasm targets

* fix: use actual usize size to access buffer.

* fix: do not run functions that create files in wasm.

* test: do not run in wasm test that panics.

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
This commit is contained in:
Luis Moreno
2021-04-28 15:58:39 -04:00
committed by GitHub
parent 5ed5772a4e
commit 162bed2aa2
71 changed files with 294 additions and 51 deletions
+3
View File
@@ -137,6 +137,7 @@ mod tests {
use super::*;
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_make_blobs() {
let dataset = make_blobs(10, 2, 3);
@@ -149,6 +150,7 @@ mod tests {
assert_eq!(dataset.num_samples, 10);
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_make_circles() {
let dataset = make_circles(10, 0.5, 0.05);
@@ -161,6 +163,7 @@ mod tests {
assert_eq!(dataset.num_samples, 10);
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
fn test_make_moons() {
let dataset = make_moons(10, 0.05);