From bf092dbd467ff844fc2aa42a19c0b3835cf4da25 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Wed, 5 Jun 2024 22:17:58 +0100 Subject: [PATCH] Include specific execution conditions --- test/examples/pass_maybe.erl | 9 +++++++++ 1 file changed, 9 insertions(+) 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.