Tests
This commit is contained in:
parent
5e61ee8e70
commit
9c487308be
6 changed files with 127 additions and 11 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -1,9 +1,22 @@
|
|||
use crate::formula::Formula;
|
||||
use crate::{formula::Formula, node::Node};
|
||||
|
||||
mod formula;
|
||||
mod node;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
fn main() {
|
||||
let formula = Formula::new();
|
||||
dbg!(formula.run(vec![1f64]));
|
||||
let mut formula = Formula::new();
|
||||
formula
|
||||
.modify_tree()
|
||||
.insert_node(Node::function(|inputs| inputs.iter().sum(), Some(2)), None);
|
||||
if let Err(x) = formula
|
||||
.modify_tree()
|
||||
.go_down(0)
|
||||
.add_node(Node::number(1f64))
|
||||
{
|
||||
println!("{x}");
|
||||
}
|
||||
formula.display_tree();
|
||||
let results = formula.run(vec![0f64, 1f64, 2f64, 3f64, 4f64, 5f64]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue