Skip to content

Commit

Permalink
Add test for altered float precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
ISibboI authored Jun 27, 2023
1 parent 3593b8f commit 8170049
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tree/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ impl Display for Node {
#[cfg(test)]
mod tests {
use crate::build_operator_tree;

#[test]
fn test_display() {
let pairs = [
Expand All @@ -114,4 +115,16 @@ mod tests {
);
}
}

#[test]
fn test_display_with_float_precision() {
assert_eq!(
&format!(
"{:.1}",
build_operator_tree("0.111").expect("Could not build operator tree")
),
"0.1"
);
}
}
}

0 comments on commit 8170049

Please sign in to comment.