Skip to content

Commit 74ce19f

Browse files
eqwalize finer_taint_SUITE
Summary: enroll, fix typing Reviewed By: kren1 Differential Revision: D88257575 fbshipit-source-id: 6a4c33401ab84026e4637c028d7f25ba3d1f2f44
1 parent 0ef45f9 commit 74ce19f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

finer_taint/test/finer_taint_SUITE.erl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
%%% @end
2323
%%% -------------------------------------------------------------------
2424
-module(finer_taint_SUITE).
25+
-typing([eqwalizer]).
2526

2627
-include_lib("common_test/include/ct.hrl").
2728
-include_lib("stdlib/include/assert.hrl").
@@ -145,9 +146,10 @@ end_per_suite(_Config) ->
145146
compile(Modules, Config) ->
146147
DataDir = ?config(data_dir, Config),
147148
CompileMod = fun(Mod) ->
148-
ModFilename = unicode:characters_to_list(io_lib:format("~p.erl", [Mod])),
149+
ModFilename = lists:flatten(io_lib:format("~p.erl", [Mod])),
149150
ModPath = filename:join([DataDir, ModFilename]),
150-
{ok, Mod, Binary} = compile:file(ModPath, [debug_info, binary]),
151+
true = is_list(ModPath),
152+
{ok, Mod, Binary = <<_/binary>>} = compile:file(ModPath, [debug_info, binary]),
151153
{ok, {Mod, [{abstract_code, {_, Forms}} | _]}} = beam_lib:chunks(Binary, [abstract_code, compile_info]),
152154
io:format("~p~n", [Forms]),
153155
{Mod, Forms}
@@ -163,11 +165,12 @@ compile_and_load(Config, Module) ->
163165
% does not crash erl_expand_records
164166
?assertNotException(error, function_clause, erl_expand_records:module(InstrumentedForms, [debug_info])),
165167
io:format("~p: ~n~s~n", [Module, erl_prettypr:format(erl_syntax:form_list(InstrumentedForms))]),
166-
{ok, Module, Binary} = compile:forms(InstrumentedForms, [debug_info, {feature, maybe_expr, enable}]),
168+
{ok, Module, Binary = <<_/binary>>} = compile:forms(InstrumentedForms, [debug_info]),
167169
DataDir = ?config(data_dir, Config),
168170
code:add_patha(DataDir),
169-
BeamFileName = unicode:characters_to_list(io_lib:format("~p.beam", [Module])),
171+
BeamFileName = lists:flatten(io_lib:format("~p.beam", [Module])),
170172
BeamPath = filename:join(DataDir, BeamFileName),
173+
true = is_list(BeamPath),
171174
ok = file:write_file(BeamPath, Binary),
172175
{module, Module} = code:load_binary(Module, BeamPath, Binary).
173176

@@ -650,7 +653,7 @@ test_comprehension(Comprehension, CompareWith) ->
650653
InstrumentedLc = finer_taint_compiler:rewrite_comprehension(Forms),
651654
case CompareWith of
652655
nocompare -> ok;
653-
print -> io:format(erl_pp:expr(InstrumentedLc));
656+
print -> io:format(lists:flatten(erl_pp:expr(InstrumentedLc)));
654657
map -> ok;
655658
map_c -> ok;
656659
_ -> ?assertEqual(CompareWith, lists:flatten(erl_pp:expr(InstrumentedLc)))
@@ -659,6 +662,8 @@ test_comprehension(Comprehension, CompareWith) ->
659662
{value, InstrumentedResult, #{}} = erl_eval:expr(InstrumentedLc, #{}),
660663
case CompareWith of
661664
map ->
665+
true = is_list(Result),
666+
true = is_list(InstrumentedResult),
662667
?assertEqual(lists:sort(Result), lists:sort(InstrumentedResult));
663668
_ ->
664669
?assertEqual(Result, InstrumentedResult)

0 commit comments

Comments
 (0)