diff --git a/test/examples/pass_maybe.erl b/test/examples/pass_maybe.erl index d882f7d8..f8bafc3f 100644 --- a/test/examples/pass_maybe.erl +++ b/test/examples/pass_maybe.erl @@ -1,10 +1,15 @@ -module(pass_maybe). +-if(?OTP_RELEASE >= 25). + -feature(maybe_expr, enable). +-endif. + -export([sum_numbers/2]). +-if(?OTP_RELEASE >= 25). sum_numbers(Number1, Number2) -> maybe ValidNumber1 ?= validate_number(Number1), @@ -19,3 +24,7 @@ validate_number(Number) when is_number(Number) -> Number; validate_number(_) -> {error, invalid_number}. +-else. +sum_numbers(Number1, Number2) -> + Number1 + Number2. +-endif.