From 20ae6a9238d3fd09587bd3f4179a8ae25f1e3aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 10 Mar 2016 18:19:16 +0100 Subject: Remove ?line macros --- erts/emulator/test/list_bif_SUITE.erl | 116 +++++++++++++++++----------------- 1 file changed, 57 insertions(+), 59 deletions(-) (limited to 'erts/emulator/test/list_bif_SUITE.erl') diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 40224723d8..1f64a6a8e5 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -37,92 +37,90 @@ all() -> %% Tests list_to_integer and string:to_integer t_list_to_integer(Config) when is_list(Config) -> - ?line {'EXIT',{badarg,_}} = (catch list_to_integer("12373281903728109372810937209817320981321ABC")), - ?line 12373281903728109372810937209817320981321 = (catch list_to_integer("12373281903728109372810937209817320981321")), - ?line 12373 = (catch list_to_integer("12373")), - ?line -12373 = (catch list_to_integer("-12373")), - ?line 12373 = (catch list_to_integer("+12373")), - ?line {'EXIT',{badarg,_}} = ( catch list_to_integer(abc)), - ?line {'EXIT',{badarg,_}} = (catch list_to_integer("")), - ?line {12373281903728109372810937209817320981321,"ABC"} = string:to_integer("12373281903728109372810937209817320981321ABC"), - ?line {-12373281903728109372810937209817320981321,"ABC"} = string:to_integer("-12373281903728109372810937209817320981321ABC"), - ?line {12,[345]} = string:to_integer([$1,$2,345]), - ?line {12,[a]} = string:to_integer([$1,$2,a]), - ?line {error,no_integer} = string:to_integer([$A]), - ?line {error,not_a_list} = string:to_integer($A), + {'EXIT',{badarg,_}} = (catch list_to_integer("12373281903728109372810937209817320981321ABC")), + 12373281903728109372810937209817320981321 = (catch list_to_integer("12373281903728109372810937209817320981321")), + 12373 = (catch list_to_integer("12373")), + -12373 = (catch list_to_integer("-12373")), + 12373 = (catch list_to_integer("+12373")), + {'EXIT',{badarg,_}} = ( catch list_to_integer(abc)), + {'EXIT',{badarg,_}} = (catch list_to_integer("")), + {12373281903728109372810937209817320981321,"ABC"} = string:to_integer("12373281903728109372810937209817320981321ABC"), + {-12373281903728109372810937209817320981321,"ABC"} = string:to_integer("-12373281903728109372810937209817320981321ABC"), + {12,[345]} = string:to_integer([$1,$2,345]), + {12,[a]} = string:to_integer([$1,$2,a]), + {error,no_integer} = string:to_integer([$A]), + {error,not_a_list} = string:to_integer($A), ok. %% Test hd/1 with correct and incorrect arguments. hd_test(Config) when is_list(Config) -> - ?line $h = hd(id("hejsan")), - ?line case catch hd(id($h)) of - {'EXIT', {badarg, _}} -> ok; - Res -> - ct:fail("hd/1 with incorrect args succeeded.~nResult: ~p", [Res]) - end, + $h = hd(id("hejsan")), + case catch hd(id($h)) of + {'EXIT', {badarg, _}} -> ok; + Res -> + ct:fail("hd/1 with incorrect args succeeded.~nResult: ~p", [Res]) + end, ok. %% Test tl/1 with correct and incorrect arguments. tl_test(Config) when is_list(Config) -> - ?line "ejsan" = tl(id("hejsan")), - ?line case catch tl(id(104)) of - {'EXIT', {badarg, _}} -> - ok; - Res -> - ct:fail("tl/1 with incorrect args succeeded.~nResult: ~p", [Res]) - end, + "ejsan" = tl(id("hejsan")), + case catch tl(id(104)) of + {'EXIT', {badarg, _}} -> + ok; + Res -> + ct:fail("tl/1 with incorrect args succeeded.~nResult: ~p", [Res]) + end, ok. %% Test length/1 with correct and incorrect arguments. t_length(Config) when is_list(Config) -> - ?line 0 = length(""), - ?line 0 = length([]), - ?line 1 = length([1]), - ?line 2 = length([1,a]), - ?line 2 = length("ab"), - ?line 3 = length("abc"), - ?line 4 = length(id([x|"abc"])), - ?line 6 = length("hejsan"), - ?line {'EXIT',{badarg,_}} = (catch length(id([a,b|c]))), - ?line case catch length({tuple}) of - {'EXIT', {badarg, _}} -> - ok; - Res -> - ct:fail("length/1 with incorrect args succeeded.~nResult: ~p", [Res]) - end, + 0 = length(""), + 0 = length([]), + 1 = length([1]), + 2 = length([1,a]), + 2 = length("ab"), + 3 = length("abc"), + 4 = length(id([x|"abc"])), + 6 = length("hejsan"), + {'EXIT',{badarg,_}} = (catch length(id([a,b|c]))), + case catch length({tuple}) of + {'EXIT', {badarg, _}} -> + ok; + Res -> + ct:fail("length/1 with incorrect args succeeded.~nResult: ~p", [Res]) + end, ok. %% Test list_to_pid/1 with correct and incorrect arguments. t_list_to_pid(Config) when is_list(Config) -> - ?line Me = self(), - ?line MyListedPid = pid_to_list(Me), - ?line Me = list_to_pid(MyListedPid), - ?line case catch list_to_pid(id("Incorrect list")) of - {'EXIT', {badarg, _}} -> - ok; - Res -> - ct:fail("list_to_pid/1 with incorrect arg succeeded.~nResult: ~p", [Res]) - end, + Me = self(), + MyListedPid = pid_to_list(Me), + Me = list_to_pid(MyListedPid), + case catch list_to_pid(id("Incorrect list")) of + {'EXIT', {badarg, _}} -> + ok; + Res -> + ct:fail("list_to_pid/1 with incorrect arg succeeded.~nResult: ~p", [Res]) + end, ok. %% Test list_to_float/1 with correct and incorrect arguments. t_list_to_float(Config) when is_list(Config) -> - ?line 5.89000 = list_to_float(id("5.89")), - ?line 5.89898 = list_to_float(id("5.89898")), - ?line case catch list_to_float(id("58")) of - {'EXIT', {badarg, _}} -> ok; - Res -> - ct:fail("list_to_float with incorrect arg succeeded.~nResult: ~p", [Res]) - end, + 5.89000 = list_to_float(id("5.89")), + 5.89898 = list_to_float(id("5.89898")), + case catch list_to_float(id("58")) of + {'EXIT', {badarg, _}} -> ok; + Res -> + ct:fail("list_to_float with incorrect arg succeeded.~nResult: ~p", [Res]) + end, ok. id(I) -> I. - - -- cgit v1.2.1