Skip to content

Commit a4469e7

Browse files
authored
Add division example to expression exercise (#2673)
1 parent f22395d commit a4469e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pattern-matching/exercise.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,16 @@ fn test_zeros() {
126126
0
127127
);
128128
}
129+
130+
#[test]
131+
fn test_div() {
132+
assert_eq!(
133+
eval(Expression::Op {
134+
op: Operation::Div,
135+
left: Box::new(Expression::Value(10)),
136+
right: Box::new(Expression::Value(2)),
137+
}),
138+
5
139+
)
140+
}
129141
// ANCHOR_END: tests

0 commit comments

Comments
 (0)