diff options
author | Björn Gustavsson <[email protected]> | 2016-02-26 13:10:05 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-02-26 13:10:05 +0100 |
commit | 63fb22fbca8fc9b3ab118b2dc2d8d2514d926903 (patch) | |
tree | d29a0e0fe4d750f19c48a19568d3f99252ffe09e /lib/compiler/test/fun_SUITE.erl | |
parent | ad847aa2f332230ea33d6a65953c9be1f22af551 (diff) | |
parent | fc3c64711400be9eae653350213630cb8cb257f9 (diff) | |
download | otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.tar.gz otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.tar.bz2 otp-63fb22fbca8fc9b3ab118b2dc2d8d2514d926903.zip |
Merge branch 'bjorn/compiler/modernize-tests'
* bjorn/compiler/modernize-tests:
Remove ?line macros
Replace use of lists:keysearch/3 with lists:keyfind/3
Eliminate use of doc and suite clauses
Replace ?t with test_server
Replace use of test_server:format/2 with io:format/2
Eliminate use of test_server:fail/0,1
Eliminate use of ?config() macro
Modernize use of timetraps
Eliminate useless helper functions
Diffstat (limited to 'lib/compiler/test/fun_SUITE.erl')
-rw-r--r-- | lib/compiler/test/fun_SUITE.erl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index c6cc5b17b3..77559ae2e6 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -60,9 +60,8 @@ l1() -> ?T((begin G = fun(1=0) -> ok end, {'EXIT',_} = (catch G(2)), ok end), ok) ]. -test1(suite) -> []; test1(Config) when is_list(Config) -> - ?line lists:foreach(fun one_test/1, eval_list(l1(), [])), + lists:foreach(fun one_test/1, eval_list(l1(), [])), ok. evaluate(Str, Vars) -> @@ -93,7 +92,7 @@ one_test({C, E, Str, Correct}) -> true -> io:format("ERROR: Compiled: ~p. Expected ~p. Got ~p.~n", [Str, Correct, C]), - test_server:fail(comp) + ct:fail(comp) end, if E == Correct -> @@ -101,7 +100,7 @@ one_test({C, E, Str, Correct}) -> true -> io:format("ERROR: Interpreted: ~p. Expected ~p. Got ~p.~n", [Str, Correct, E]), - test_server:fail(comp) + ct:fail(comp) end. -record(b, {c}). @@ -109,9 +108,9 @@ one_test({C, E, Str, Correct}) -> %% OTP-7102. (Thanks to Simon Cornish.) overwritten_fun(Config) when is_list(Config) -> - ?line {a2,a} = overwritten_fun_1(a), - ?line {a2,{b,c}} = overwritten_fun_1(#b{c=c}), - ?line one = overwritten_fun_1(#b{c=[]}), + {a2,a} = overwritten_fun_1(a), + {a2,{b,c}} = overwritten_fun_1(#b{c=c}), + one = overwritten_fun_1(#b{c=[]}), ok. overwritten_fun_1(A) -> @@ -153,8 +152,8 @@ otp_7202_func() -> no_value. bif_fun(Config) when is_list(Config) -> - ?line F = fun abs/1, - ?line 5 = F(-5), + F = fun abs/1, + 5 = F(-5), ok. -define(APPLY(M, F, A), (fun(Fun) -> {ok,{a,b}} = Fun({a,b}) end)(fun M:F/A)). |