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:
parent
f22395d278
commit
a4469e7a91
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user