1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-20 15:08:02 +02:00

Add division example to expression exercise (#2673)

This commit is contained in:
Nicole L 2025-02-28 10:30:54 -08:00 committed by GitHub
parent f22395d278
commit a4469e7a91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,4 +126,16 @@ fn test_zeros() {
0
);
}
#[test]
fn test_div() {
assert_eq!(
eval(Expression::Op {
op: Operation::Div,
left: Box::new(Expression::Value(10)),
right: Box::new(Expression::Value(2)),
}),
5
)
}
// ANCHOR_END: tests