Add new integration test scenario 031
```
× clamp_1 failed
help: ┍━ left ━━━━━━━━━━┑
│ (con integer 0) │
┕━━━━━━━━━━━━━━━━━┙
should be equal to
┍━ right ━━━━━━━━━━┑
│ (con integer 10) │
┕━━━━━━━━━━━━━━━━━━┙
```
This commit is contained in:
parent
030172e1dc
commit
102bb7735e
|
|
@ -0,0 +1,2 @@
|
|||
name = "acceptance_test_031"
|
||||
version = "0.0.0"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
pub fn clamp(n: Int, min min: Int, max max: Int) -> Int {
|
||||
if n < min {
|
||||
min
|
||||
} else if n > max {
|
||||
max
|
||||
} else {
|
||||
n
|
||||
}
|
||||
}
|
||||
|
||||
test clamp_1() {
|
||||
clamp(14, min: 0, max: 10) == 10
|
||||
}
|
||||
Loading…
Reference in New Issue