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:
2
examples/acceptance_tests/031/aiken.toml
Normal file
2
examples/acceptance_tests/031/aiken.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = "acceptance_test_031"
|
||||||
|
version = "0.0.0"
|
||||||
13
examples/acceptance_tests/031/lib/test.ak
Normal file
13
examples/acceptance_tests/031/lib/test.ak
Normal file
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user