From a94361075998359469c8f2130d2ba64f2d7fcb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 21 Mar 2016 17:36:05 +0100 Subject: Eliminate ?line macros --- lib/erl_interface/test/erl_match_SUITE.erl | 295 ++++++++++++++--------------- 1 file changed, 144 insertions(+), 151 deletions(-) (limited to 'lib/erl_interface/test/erl_match_SUITE.erl') diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index ecdebad212..07122f2edf 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -24,10 +24,10 @@ -include_lib("common_test/include/ct.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, - atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, - bind/1, integers/1, floats/1, binaries/1, strings/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, + bind/1, integers/1, floats/1, binaries/1, strings/1]). %% For interactive running of matcher. -export([start_matcher/1, erl_match/3]). @@ -58,212 +58,210 @@ end_per_group(_GroupName, Config) -> atoms(suite) -> []; atoms(Config) when is_list(Config) -> - ?line P = start_matcher(Config), + P = start_matcher(Config), - ?line eq(P, '', ''), - ?line eq(P, a, a), - ?line ne(P, a, b), - ?line ne(P, a, aa), - ?line eq(P, kalle, kalle), - ?line ne(P, kalle, arne), + eq(P, '', ''), + eq(P, a, a), + ne(P, a, b), + ne(P, a, aa), + eq(P, kalle, kalle), + ne(P, kalle, arne), - ?line ne(P, kalle, 42), - ?line ne(P, 42, kalle), + ne(P, kalle, 42), + ne(P, 42, kalle), - ?line runner:finish(P), + runner:finish(P), ok. lists(suite) -> []; lists(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line eq(P, [], []), + P = start_matcher(Config), + eq(P, [], []), - ?line ne(P, [], [a]), - ?line ne(P, [a], []), + ne(P, [], [a]), + ne(P, [a], []), - ?line eq(P, [a], [a]), - ?line ne(P, [a], [b]), + eq(P, [a], [a]), + ne(P, [a], [b]), - ?line eq(P, [a|b], [a|b]), - ?line ne(P, [a|b], [a|x]), + eq(P, [a|b], [a|b]), + ne(P, [a|b], [a|x]), - ?line eq(P, [a, b], [a, b]), - ?line ne(P, [a, b], [a, x]), + eq(P, [a, b], [a, b]), + ne(P, [a, b], [a, x]), - ?line eq(P, [a, b, c], [a, b, c]), - ?line ne(P, [a, b|c], [a, b|x]), - ?line ne(P, [a, b, c], [a, b, x]), - ?line ne(P, [a, b|c], [a, b|x]), - ?line ne(P, [a, x|c], [a, b|c]), - ?line ne(P, [a, b, c], [a, x, c]), + eq(P, [a, b, c], [a, b, c]), + ne(P, [a, b|c], [a, b|x]), + ne(P, [a, b, c], [a, b, x]), + ne(P, [a, b|c], [a, b|x]), + ne(P, [a, x|c], [a, b|c]), + ne(P, [a, b, c], [a, x, c]), - ?line runner:finish(P), + runner:finish(P), ok. tuples(suite) -> []; tuples(Config) when is_list(Config) -> - ?line P = start_matcher(Config), + P = start_matcher(Config), - ?line ne(P, {}, {a, b}), - ?line ne(P, {a, b}, {}), - ?line ne(P, {a}, {a, b}), - ?line ne(P, {a, b}, {a}), + ne(P, {}, {a, b}), + ne(P, {a, b}, {}), + ne(P, {a}, {a, b}), + ne(P, {a, b}, {a}), - ?line eq(P, {}, {}), + eq(P, {}, {}), - ?line eq(P, {a}, {a}), - ?line ne(P, {a}, {b}), + eq(P, {a}, {a}), + ne(P, {a}, {b}), - ?line eq(P, {1}, {1}), - ?line ne(P, {1}, {2}), + eq(P, {1}, {1}), + ne(P, {1}, {2}), - ?line eq(P, {a, b}, {a, b}), - ?line ne(P, {x, b}, {a, b}), + eq(P, {a, b}, {a, b}), + ne(P, {x, b}, {a, b}), - ?line ne(P, {error, x}, {error, y}), - ?line ne(P, {error, {undefined, {subscriber, last}}}, - {error, {undefined, {subscriber, name}}}), + ne(P, {error, x}, {error, y}), + ne(P, {error, {undefined, {subscriber, last}}}, + {error, {undefined, {subscriber, name}}}), - ?line runner:finish(P), + runner:finish(P), ok. references(suite) -> []; references(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line Ref1 = make_ref(), - ?line Ref2 = make_ref(), - - ?line eq(P, Ref1, Ref1), - ?line eq(P, Ref2, Ref2), - ?line ne(P, Ref1, Ref2), - ?line ne(P, Ref2, Ref1), - - ?line runner:finish(P), + P = start_matcher(Config), + Ref1 = make_ref(), + Ref2 = make_ref(), + + eq(P, Ref1, Ref1), + eq(P, Ref2, Ref2), + ne(P, Ref1, Ref2), + ne(P, Ref2, Ref1), + + runner:finish(P), ok. pids(suite) -> []; pids(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line Pid1 = c:pid(0,1,2), - ?line Pid2 = c:pid(0,1,3), - - ?line eq(P, self(), self()), - ?line eq(P, Pid1, Pid1), - ?line ne(P, Pid1, self()), - ?line ne(P, Pid2, Pid1), - - ?line runner:finish(P), + P = start_matcher(Config), + Pid1 = c:pid(0,1,2), + Pid2 = c:pid(0,1,3), + + eq(P, self(), self()), + eq(P, Pid1, Pid1), + ne(P, Pid1, self()), + ne(P, Pid2, Pid1), + + runner:finish(P), ok. ports(suite) -> []; ports(Config) when is_list(Config) -> case os:type() of - vxworks -> - {skipped,"not on vxworks, pucko"}; - _ -> - ?line P = start_matcher(Config), - ?line P2 = start_matcher(Config), - - ?line eq(P, P, P), - ?line ne(P, P, P2), - - ?line runner:finish(P), - ?line runner:finish(P2), - ok + vxworks -> + {skipped,"not on vxworks, pucko"}; + _ -> + P = start_matcher(Config), + P2 = start_matcher(Config), + + eq(P, P, P), + ne(P, P, P2), + + runner:finish(P), + runner:finish(P2), + ok end. integers(suite) -> []; integers(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line I1 = 123, - ?line I2 = 12345, - ?line I3 = -123, - ?line I4 = 2234, - - ?line eq(P, I1, I1), - ?line eq(P, I2, I2), - ?line ne(P, I1, I2), - ?line ne(P, I1, I3), - ?line eq(P, I4, I4), - - ?line runner:finish(P), + P = start_matcher(Config), + I1 = 123, + I2 = 12345, + I3 = -123, + I4 = 2234, + + eq(P, I1, I1), + eq(P, I2, I2), + ne(P, I1, I2), + ne(P, I1, I3), + eq(P, I4, I4), + + runner:finish(P), ok. floats(suite) -> []; floats(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line F1 = 3.1414, - ?line F2 = 3.1415, - ?line F3 = 3.1416, - - ?line S1 = "string", - ?line S2 = "string2", - - ?line eq(P, F1, F1), - ?line eq(P, F2, F2), - ?line ne(P, F1, F2), - ?line ne(P, F3, F2), - - ?line eq(P, S2, S2), - ?line ne(P, S1, S2), - - ?line runner:finish(P), + P = start_matcher(Config), + F1 = 3.1414, + F2 = 3.1415, + F3 = 3.1416, + + S1 = "string", + S2 = "string2", + + eq(P, F1, F1), + eq(P, F2, F2), + ne(P, F1, F2), + ne(P, F3, F2), + + eq(P, S2, S2), + ne(P, S1, S2), + + runner:finish(P), ok. binaries(suite) -> []; binaries(Config) when is_list(Config) -> - ?line P = start_matcher(Config), - ?line Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}), - ?line Bin2 = term_to_binary(sune), - ?line Bin3 = list_to_binary("sune"), - - ?line eq(P, Bin1, Bin1), - ?line eq(P, Bin2, Bin2), - ?line eq(P, Bin3, Bin3), - ?line ne(P, Bin1, Bin2), - ?line ne(P, Bin1, Bin3), - ?line ne(P, Bin2, Bin3), - - ?line runner:finish(P), + P = start_matcher(Config), + Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}), + Bin2 = term_to_binary(sune), + Bin3 = list_to_binary("sune"), + + eq(P, Bin1, Bin1), + eq(P, Bin2, Bin2), + eq(P, Bin3, Bin3), + ne(P, Bin1, Bin2), + ne(P, Bin1, Bin3), + ne(P, Bin2, Bin3), + + runner:finish(P), ok. - strings(suite) -> []; strings(Config) when is_list(Config) -> - ?line P = start_matcher(Config), + P = start_matcher(Config), - ?line S1 = "string", - ?line S2 = "streng", - ?line S3 = "String", - - ?line eq(P, S1, S1), - ?line ne(P, S1, S2), - ?line ne(P, S1, S3), + S1 = "string", + S2 = "streng", + S3 = "String", - ?line runner:finish(P), - ok. + eq(P, S1, S1), + ne(P, S1, S2), + ne(P, S1, S3), + runner:finish(P), + ok. bind(suite) -> []; bind(Config) when is_list(Config) -> - ?line P = start_bind(Config), - ?line S = "[X,Y,Z]", - ?line L1 = [301,302,302], - ?line L2 = [65,66,67], - - ?line bind_ok(P, S, L1), - ?line bind_ok(P, S, L2), - - ?line runner:finish(P), + P = start_bind(Config), + S = "[X,Y,Z]", + L1 = [301,302,302], + L2 = [65,66,67], + + bind_ok(P, S, L1), + bind_ok(P, S, L2), + + runner:finish(P), ok. start_bind(Config) -> @@ -279,15 +277,12 @@ erl_bind(Port, Pattern, Term) -> Port ! {self(), {command, [$b, Pattern, 0]}}, runner:send_term(Port, Term), case runner:get_term(Port) of - {term, 0} -> false; - {term, 1} -> true + {term, 0} -> false; + {term, 1} -> true end. - - - start_matcher(Config) -> runner:start(?erl_match_server). @@ -303,8 +298,6 @@ erl_match(Port, Pattern, Term) -> runner:send_term(Port, Pattern), runner:send_term(Port, Term), case runner:get_term(Port) of - {term, 0} -> false; - {term, 1} -> true + {term, 0} -> false; + {term, 1} -> true end. - - -- cgit v1.2.3 From 21ae34f1d5d19e0d42a2b2ed77c0e0b092865b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 21 Mar 2016 18:21:09 +0100 Subject: Eliminate suite and doc clauses --- lib/erl_interface/test/erl_match_SUITE.erl | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'lib/erl_interface/test/erl_match_SUITE.erl') diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index 07122f2edf..a40f86f277 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -56,7 +56,6 @@ end_per_group(_GroupName, Config) -> Config. -atoms(suite) -> []; atoms(Config) when is_list(Config) -> P = start_matcher(Config), @@ -73,7 +72,6 @@ atoms(Config) when is_list(Config) -> runner:finish(P), ok. -lists(suite) -> []; lists(Config) when is_list(Config) -> P = start_matcher(Config), eq(P, [], []), @@ -100,7 +98,6 @@ lists(Config) when is_list(Config) -> runner:finish(P), ok. -tuples(suite) -> []; tuples(Config) when is_list(Config) -> P = start_matcher(Config), @@ -128,7 +125,6 @@ tuples(Config) when is_list(Config) -> ok. -references(suite) -> []; references(Config) when is_list(Config) -> P = start_matcher(Config), Ref1 = make_ref(), @@ -143,7 +139,6 @@ references(Config) when is_list(Config) -> ok. -pids(suite) -> []; pids(Config) when is_list(Config) -> P = start_matcher(Config), Pid1 = c:pid(0,1,2), @@ -158,7 +153,6 @@ pids(Config) when is_list(Config) -> ok. -ports(suite) -> []; ports(Config) when is_list(Config) -> case os:type() of vxworks -> @@ -175,7 +169,6 @@ ports(Config) when is_list(Config) -> ok end. -integers(suite) -> []; integers(Config) when is_list(Config) -> P = start_matcher(Config), I1 = 123, @@ -194,7 +187,6 @@ integers(Config) when is_list(Config) -> -floats(suite) -> []; floats(Config) when is_list(Config) -> P = start_matcher(Config), F1 = 3.1414, @@ -217,7 +209,6 @@ floats(Config) when is_list(Config) -> -binaries(suite) -> []; binaries(Config) when is_list(Config) -> P = start_matcher(Config), Bin1 = term_to_binary({kalle, 146015, {kungsgatan, 23}}), @@ -235,7 +226,6 @@ binaries(Config) when is_list(Config) -> ok. -strings(suite) -> []; strings(Config) when is_list(Config) -> P = start_matcher(Config), @@ -251,7 +241,6 @@ strings(Config) when is_list(Config) -> ok. -bind(suite) -> []; bind(Config) when is_list(Config) -> P = start_bind(Config), S = "[X,Y,Z]", -- cgit v1.2.3 From f67d7e7ba88fb882beb1c43b5efbb9c8b2345eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 21 Mar 2016 18:29:51 +0100 Subject: Remove unncecessary exports --- lib/erl_interface/test/erl_match_SUITE.erl | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'lib/erl_interface/test/erl_match_SUITE.erl') diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index a40f86f277..5a40c19e3b 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -24,8 +24,7 @@ -include_lib("common_test/include/ct.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, +-export([all/0, suite/0, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, bind/1, integers/1, floats/1, binaries/1, strings/1]). @@ -34,27 +33,13 @@ %% This test suite tests the erl_match() function. -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}]. all() -> [atoms, lists, tuples, references, pids, ports, bind, integers, floats, binaries, strings]. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - atoms(Config) when is_list(Config) -> P = start_matcher(Config), -- cgit v1.2.3