test(parse): create a slice directly
This commit is contained in:
parent
50fa80df27
commit
98413eb1b7
1 changed files with 2 additions and 3 deletions
|
|
@ -150,14 +150,13 @@ fn nodes_from_str(s: &str) -> Result<Vec<Node>, Error> {
|
|||
fn test_nodes_from_str() {
|
||||
assert_eq!(
|
||||
nodes_from_str("sin(2) + 1").unwrap().as_slice(),
|
||||
vec![
|
||||
&[
|
||||
Node::Function(Function::Sine),
|
||||
Node::ParenthesisStart,
|
||||
Node::Number(Float::with_val(512, 2)),
|
||||
Node::ParenthesisEnd,
|
||||
Node::Operator(Operator::Plus),
|
||||
Node::Number(Float::with_val(512, 1))
|
||||
]
|
||||
.as_slice(),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue