You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-27 11:08:45 +02:00
Add division example to expression exercise (#2673)
This commit is contained in:
@ -126,4 +126,16 @@ fn test_zeros() {
|
|||||||
0
|
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
|
// ANCHOR_END: tests
|
||||||
|
Reference in New Issue
Block a user