Skip to content

Commit 1d2d436

Browse files
committed
Merge pull request #2261 from pguyot/w15/fix-timer-test-warning
Fix test_timer assertions These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 078004b + 5a32c0d commit 1d2d436

1 file changed

Lines changed: 36 additions & 30 deletions

File tree

tests/libs/estdlib/test_timer.erl

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -86,41 +86,47 @@ test_infinity() ->
8686

8787
test_send_after_2() ->
8888
{ok, _TRef} = timer:send_after(500, hello),
89-
receive
90-
hello -> {error, too_early}
91-
after 250 ->
92-
ok
93-
end,
94-
receive
95-
hello -> ok
96-
after 10000 ->
97-
{error, timeout}
98-
end.
89+
ok =
90+
receive
91+
hello -> {error, too_early}
92+
after 250 ->
93+
ok
94+
end,
95+
ok =
96+
receive
97+
hello -> ok
98+
after 10000 ->
99+
{error, timeout}
100+
end.
99101

100102
test_send_after_3() ->
101103
Self = self(),
102104
{ok, _TRef} = timer:send_after(500, Self, hello_dest),
103-
receive
104-
hello_dest -> {error, too_early}
105-
after 250 ->
106-
ok
107-
end,
108-
receive
109-
hello_dest -> ok
110-
after 10000 ->
111-
{error, timeout}
112-
end.
105+
ok =
106+
receive
107+
hello_dest -> {error, too_early}
108+
after 250 ->
109+
ok
110+
end,
111+
ok =
112+
receive
113+
hello_dest -> ok
114+
after 10000 ->
115+
{error, timeout}
116+
end.
113117

114118
test_apply_after() ->
115119
Self = self(),
116120
{ok, _TRef} = timer:apply_after(500, erlang, send, [Self, apply_result]),
117-
receive
118-
apply_result -> {error, too_early}
119-
after 250 ->
120-
ok
121-
end,
122-
receive
123-
apply_result -> ok
124-
after 10000 ->
125-
{error, timeout}
126-
end.
121+
ok =
122+
receive
123+
apply_result -> {error, too_early}
124+
after 250 ->
125+
ok
126+
end,
127+
ok =
128+
receive
129+
apply_result -> ok
130+
after 10000 ->
131+
{error, timeout}
132+
end.

0 commit comments

Comments
 (0)