Skip to content

Commit 54331b6

Browse files
committed
Fix new tests for earlier OTP versions
1 parent 8b836a3 commit 54331b6

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

test/should_fail/map_comprehension_fail.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-module(map_comprehension_fail).
22

3+
-ifdef(OTP_RELEASE).
4+
-if(?OTP_RELEASE >= 27).
5+
36
%% Each exported function should produce exactly one type error.
47

58
-export([mc_wrong_return_type/0, map_gen_not_map/1]).
@@ -13,3 +16,6 @@ mc_wrong_return_type() ->
1316
-spec map_gen_not_map(integer()) -> [integer()].
1417
map_gen_not_map(N) ->
1518
[V || _K := V <- N].
19+
20+
-endif. %% OTP >= 27
21+
-endif. %% OTP_RELEASE

test/should_fail/sigils_fail.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-module(sigils_fail).
22

3+
-ifdef(OTP_RELEASE).
4+
-if(?OTP_RELEASE >= 27).
5+
36
%% Each exported function should produce exactly one type error.
47

58
-export([sigil_wrong_type/0]).
@@ -8,3 +11,6 @@
811
-spec sigil_wrong_type() -> integer().
912
sigil_wrong_type() ->
1013
~"hello".
14+
15+
-endif. %% OTP >= 27
16+
-endif. %% OTP_RELEASE

test/should_pass/map_comprehension_pass.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-module(map_comprehension_pass).
22

3+
-ifdef(OTP_RELEASE).
4+
-if(?OTP_RELEASE >= 27).
5+
36
-compile([export_all, nowarn_export_all]).
47

58
%% Basic map comprehension with list generator
@@ -61,3 +64,6 @@ mc_any_map() ->
6164
-spec mixed_generators(#{atom() => integer()}) -> [{integer(), atom()}].
6265
mixed_generators(M) ->
6366
[{V, K} || K := V <- M].
67+
68+
-endif. %% OTP >= 27
69+
-endif. %% OTP_RELEASE

test/should_pass/sigils_and_doc_pass.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-module(sigils_and_doc_pass).
22

3+
-ifdef(OTP_RELEASE).
4+
-if(?OTP_RELEASE >= 27).
5+
36
-compile([export_all, nowarn_export_all]).
47

58
%% -doc attribute (OTP 27+)
@@ -33,3 +36,6 @@ sigil_concat() ->
3336
-spec sigil_arg() -> non_neg_integer().
3437
sigil_arg() ->
3538
byte_size(~"hello").
39+
40+
-endif. %% OTP >= 27
41+
-endif. %% OTP_RELEASE

0 commit comments

Comments
 (0)