test(parse): create a slice directly

This commit is contained in:
electria 2026-06-18 18:57:58 -07:00
commit 98413eb1b7
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -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(),
],
)
}