Turn non-automated tests into Cargo examples #24

Merged
glen merged 7 commits from cargo-examples_on_main into main 2024-11-26 00:32:51 +00:00
2 changed files with 4 additions and 6 deletions
Showing only changes of commit 848f7d665b - Show all commits

View File

@ -6,7 +6,7 @@ edition = "2021"
[features]
default = ["console_error_panic_hook"]
irisawa = []
dev = []
[dependencies]
itertools = "0.13.0"
@ -42,7 +42,7 @@ features = [
# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987
#
[dev-dependencies]
dyna3 = { path = ".", default-features = false, features = ["irisawa"] }
dyna3 = { path = ".", default-features = false, features = ["dev"] }
wasm-bindgen-test = "0.3.34"
[profile.release]

View File

@ -4,9 +4,7 @@ use web_sys::{console, wasm_bindgen::JsValue}; /* DEBUG */
// --- elements ---
/* KLUDGE */
// temporarily remove test gate so we can use `point` in examples
/* #[cfg(test)] */
#[cfg(feature = "dev")]
pub fn point(x: f64, y: f64, z: f64) -> DVector<f64> {
DVector::from_column_slice(&[x, y, z, 0.5, 0.5*(x*x + y*y + z*z)])
}
@ -287,7 +285,7 @@ pub fn realize_gram(
// "Japan's 'Wasan' Mathematical Tradition", by Abe Haruki
// https://www.nippon.com/en/japan-topics/c12801/
//
#[cfg(feature = "irisawa")]
#[cfg(feature = "dev")]
pub mod irisawa {
use std::{array, f64::consts::PI};