Use computed constants for integration test guard clauses
@@ -769,6 +769,9 @@ fn prelude_tests(_fns) -> List(Test) {
}
fn alternative_patterns_tests(_fns) -> List(Test) {
+ let int_one = make_int_zero() + 1
+ let int_two = make_int_zero() + 2
+
[
"numbers"
|> example(fn() {
@@ -815,7 +818,7 @@ fn alternative_patterns_tests(_fns) -> List(Test) {
assert_equal(
2,
case [1, 2] {
- [x] | [_, x] if x == 2 -> x
+ [x] | [_, x] if x == int_two -> x
_ -> 0
},
)
@@ -825,7 +828,7 @@ fn alternative_patterns_tests(_fns) -> List(Test) {
assert_equal(
1,
case [1] {
- [x] | [_, x] if x == 1 -> x
+ [x] | [_, x] if x == int_one -> x
_ -> 0
},
)
