Skip to content

Commit 5fc4e8c

Browse files
committed
Fix version bounds on some new tests
1 parent bf6e67f commit 5fc4e8c

6 files changed

Lines changed: 35 additions & 14 deletions

File tree

test/should_fail/strict_generators_fail.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-module(strict_generators_fail).
22

33
-ifdef(OTP_RELEASE).
4-
-if(?OTP_RELEASE >= 27).
4+
-if(?OTP_RELEASE >= 28).
55

66
%% Each exported function should produce exactly one type error.
77

@@ -17,5 +17,5 @@ strict_gen_not_list(N) ->
1717
strict_gen_wrong_type() ->
1818
[X || X <:- [1, 2, 3]].
1919

20-
-endif. %% OTP >= 27
20+
-endif. %% OTP >= 28
2121
-endif. %% OTP_RELEASE

test/should_fail/zip_generators_fail.erl

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

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

58
-export([zip_not_list/1, zip_wrong_return/0]).
@@ -13,3 +16,6 @@ zip_not_list(N) ->
1316
-spec zip_wrong_return() -> integer().
1417
zip_wrong_return() ->
1518
[{X, Y} || X <- [1, 2] && Y <- [a, b]].
19+
20+
-endif. %% OTP >= 28
21+
-endif. %% OTP_RELEASE

test/should_pass/map_comprehension_pass.erl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@ mc_from_binary() ->
4545
bc_from_map(M) ->
4646
<< <<V>> || _K := V <- M >>.
4747

48-
%% Strict map generator
49-
-spec strict_mc(#{atom() => integer()}) -> #{atom() => integer()}.
50-
strict_mc(M) ->
51-
#{K => V + 1 || K := V <:- M}.
52-
53-
%% Strict map generator in list comprehension
54-
-spec strict_map_gen_lc(#{atom() => integer()}) -> [integer()].
55-
strict_map_gen_lc(M) ->
56-
[V || _K := V <:- M].
57-
5848
%% Map comprehension with any() map
5949
-spec mc_any_map() -> map().
6050
mc_any_map() ->

test/should_pass/strict_generators_pass.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-module(strict_generators_pass).
22

33
-ifdef(OTP_RELEASE).
4-
-if(?OTP_RELEASE >= 27).
4+
-if(?OTP_RELEASE >= 28).
55

66
-compile([export_all, nowarn_export_all]).
77

@@ -50,5 +50,5 @@ strict_any_list() ->
5050
strict_union_list() ->
5151
[X || X <:- [apa, bepa]].
5252

53-
-endif. %% OTP >= 27
53+
-endif. %% OTP >= 28
5454
-endif. %% OTP_RELEASE
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-module(strict_map_comprehension_pass).
2+
3+
-ifdef(OTP_RELEASE).
4+
-if(?OTP_RELEASE >= 28).
5+
6+
-compile([export_all, nowarn_export_all]).
7+
8+
%% Strict map generator
9+
-spec strict_mc(#{atom() => integer()}) -> #{atom() => integer()}.
10+
strict_mc(M) ->
11+
#{K => V + 1 || K := V <:- M}.
12+
13+
%% Strict map generator in list comprehension
14+
-spec strict_map_gen_lc(#{atom() => integer()}) -> [integer()].
15+
strict_map_gen_lc(M) ->
16+
[V || _K := V <:- M].
17+
18+
-endif. %% OTP >= 28
19+
-endif. %% OTP_RELEASE

test/should_pass/zip_generators_pass.erl

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

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

58
%% Basic zip generator - two list generators in lockstep
@@ -63,3 +66,6 @@ zip_outer_scope_in_arms(N) ->
6366
-spec zip_body_sees_rebound(atom()) -> [integer()].
6467
zip_body_sees_rebound(X) ->
6568
[X || X <- [1, 2, 3] && _Y <- [a, b, c]].
69+
70+
-endif. %% OTP >= 28
71+
-endif. %% OTP_RELEASE

0 commit comments

Comments
 (0)