Skip to content

Commit

Permalink
Fix erl_scan testcase swallowing errors
Browse files Browse the repository at this point in the history
When the call to erl_scan succeeded returning more than one token,
for example "123_", the unexpected success was not detected.
  • Loading branch information
richcarl committed Nov 23, 2024
1 parent 171fb25 commit b92e961
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/stdlib/test/erl_scan_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ integers() ->
lists:foreach(
fun(S) ->
case erl_scan:string(S) of
{ok, [{integer, _, _}], _} ->
{ok, [{integer, _, _}|_], _} ->
error({unexpected_integer, S});
_ ->
ok
Expand Down Expand Up @@ -388,7 +388,7 @@ base_integers() ->
lists:foreach(
fun(S) ->
case erl_scan:string(S) of
{ok, [{integer, _, _}], _} ->
{ok, [{integer, _, _}|_], _} ->
error({unexpected_integer, S});
_ ->
ok
Expand Down Expand Up @@ -441,7 +441,7 @@ floats() ->
lists:foreach(
fun(S) ->
case erl_scan:string(S) of
{ok, [{float, _, _}], _} ->
{ok, [{float, _, _}|_], _} ->
error({unexpected_float, S});
_ ->
ok
Expand Down

0 comments on commit b92e961

Please sign in to comment.