test error inspection
This commit is contained in:
parent
20e931d2ea
commit
757e854d45
1 changed files with 5 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ fn test_plus_one() {
|
||||||
),
|
),
|
||||||
None
|
None
|
||||||
)
|
)
|
||||||
|
.inspect_err(|x| println!("{x}"))
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
let results = formula.run(vec![0f64, 1f64, 2f64, 3f64, 4f64, 5f64]);
|
let results = formula.run(vec![0f64, 1f64, 2f64, 3f64, 4f64, 5f64]);
|
||||||
|
|
@ -38,6 +39,7 @@ fn test_branch_sum() {
|
||||||
Node::function("Sum".to_string(), |inputs| inputs.iter().sum(), Some(2), 0),
|
Node::function("Sum".to_string(), |inputs| inputs.iter().sum(), Some(2), 0),
|
||||||
None
|
None
|
||||||
)
|
)
|
||||||
|
.inspect_err(|x| println!("{x}"))
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
|
@ -61,6 +63,7 @@ fn test_display_as_text() {
|
||||||
Node::function("sum".to_string(), |inputs| inputs.iter().sum(), None, 0),
|
Node::function("sum".to_string(), |inputs| inputs.iter().sum(), None, 0),
|
||||||
None
|
None
|
||||||
)
|
)
|
||||||
|
.inspect_err(|x| println!("{x}"))
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
|
@ -73,6 +76,7 @@ fn test_display_as_text() {
|
||||||
Some(1),
|
Some(1),
|
||||||
0
|
0
|
||||||
))
|
))
|
||||||
|
.inspect_err(|x| println!("{x}"))
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
|
@ -81,6 +85,7 @@ fn test_display_as_text() {
|
||||||
.go_down(0)
|
.go_down(0)
|
||||||
.go_down(1)
|
.go_down(1)
|
||||||
.add_node(Node::variable())
|
.add_node(Node::variable())
|
||||||
|
.inspect_err(|x| println!("{x}"))
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
assert_eq!(formula.as_text(), "sum(X,sin(X))".to_string());
|
assert_eq!(formula.as_text(), "sum(X,sin(X))".to_string());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue