From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- lib/stdlib/test/digraph_utils_SUITE.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 6b554c2fb7..747ccf322c 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -3,16 +3,17 @@ %% %% Copyright Ericsson AB 2000-2012. All Rights Reserved. %% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% %% -- cgit v1.2.3 From 03fcb7dabf8861e60ffab4121a909b347bccfec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 15 Feb 2016 15:33:12 +0100 Subject: Eliminate use of test_server.hrl and test_server_line.hrl As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl. --- lib/stdlib/test/digraph_utils_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 747ccf322c..e155857bd4 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -23,7 +23,7 @@ -ifdef(debug). -define(line, put(line, ?LINE), ). -else. --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -endif. -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, -- cgit v1.2.3 From 03ec5bc984264feee907408e720015e2bd9b6108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 28 Feb 2016 14:10:25 +0100 Subject: Eliminate 'suite' and 'doc' clauses --- lib/stdlib/test/digraph_utils_SUITE.erl | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index e155857bd4..25728d3552 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -59,8 +59,6 @@ end_per_group(_GroupName, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -simple(doc) -> []; -simple(suite) -> []; simple(Config) when is_list(Config) -> ?line G = digraph:new(), ?line add_vertices(G, [a]), @@ -97,8 +95,6 @@ simple(Config) when is_list(Config) -> ?line true = digraph:delete(G), ok. -loop(doc) -> []; -loop(suite) -> []; loop(Config) when is_list(Config) -> ?line G = digraph:new(), ?line add_vertices(G, [a,b]), @@ -119,8 +115,6 @@ loop(Config) when is_list(Config) -> ?line true = digraph:delete(G), ok. -isolated(doc) -> []; -isolated(suite) -> []; isolated(Config) when is_list(Config) -> ?line G = digraph:new(), ?line add_vertices(G, [a,b]), @@ -140,8 +134,6 @@ isolated(Config) when is_list(Config) -> ?line true = digraph:delete(G), ok. -topsort(doc) -> []; -topsort(suite) -> []; topsort(Config) when is_list(Config) -> ?line G = digraph:new(), ?line add_edges(G, [{a,b},{b,c},{c,d},{d,e},{e,f}]), @@ -149,8 +141,6 @@ topsort(Config) when is_list(Config) -> ?line true = digraph:delete(G), ok. -subgraph(doc) -> []; -subgraph(suite) -> []; subgraph(Config) when is_list(Config) -> ?line G = digraph:new([acyclic]), ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, @@ -197,8 +187,6 @@ subgraph(Config) when is_list(Config) -> ok. -condensation(doc) -> []; -condensation(suite) -> []; condensation(Config) when is_list(Config) -> ?line G = digraph:new([]), ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, @@ -217,8 +205,7 @@ condensation(Config) when is_list(Config) -> ?line true = digraph:delete(G), ok. -tree(doc) -> ["OTP-7081"]; -tree(suite) -> []; +%% OTP-7081 tree(Config) when is_list(Config) -> ?line false = is_tree([], []), ?line true = is_tree([a], []), -- cgit v1.2.3 From 477f490820a28e479527e93d420f26ea23fdf3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Mar 2016 06:33:45 +0100 Subject: Replace "%" with "%%" at the beginning of a line We want to re-ident the source files after having taken out all ?line macros. When re-indenting using Emacs, it's important that comments that should be at the beginning of a line (or follow the indentation of statements around it) must start with "%%". --- lib/stdlib/test/digraph_utils_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 25728d3552..743da8da1a 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -19,7 +19,7 @@ %% -module(digraph_utils_SUITE). -%-define(debug, true). +%%-define(debug, true). -ifdef(debug). -define(line, put(line, ?LINE), ). -else. -- cgit v1.2.3 From 33b414783b37dc0c242c729fa3fa843cd648e3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Mar 2016 06:50:54 +0100 Subject: Remove ?line macros While we are it, also re-ident the files. --- lib/stdlib/test/digraph_utils_SUITE.erl | 310 ++++++++++++++++---------------- 1 file changed, 155 insertions(+), 155 deletions(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 743da8da1a..23520072f8 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -60,191 +60,191 @@ end_per_group(_GroupName, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% simple(Config) when is_list(Config) -> - ?line G = digraph:new(), - ?line add_vertices(G, [a]), - ?line add_edges(G, [{b,c},{b,d},{e,f},{f,g},{g,e},{h,h},{i,i},{i,j}]), - ?line 10 = length(digraph_utils:postorder(G)), - ?line 10 = length(digraph_utils:preorder(G)), - ?line ok = evall(digraph_utils:components(G), - [[a],[b,c,d],[e,f,g],[h],[i,j]]), - ?line ok = evall(digraph_utils:strong_components(G), + G = digraph:new(), + add_vertices(G, [a]), + add_edges(G, [{b,c},{b,d},{e,f},{f,g},{g,e},{h,h},{i,i},{i,j}]), + 10 = length(digraph_utils:postorder(G)), + 10 = length(digraph_utils:preorder(G)), + ok = evall(digraph_utils:components(G), + [[a],[b,c,d],[e,f,g],[h],[i,j]]), + ok = evall(digraph_utils:strong_components(G), [[a],[b],[c],[d],[e,f,g],[h],[i],[j]]), - ?line ok = evall(digraph_utils:cyclic_strong_components(G), - [[e,f,g],[h],[i]]), - ?line true = path(G, e, e), - ?line false = path(G, e, j), - ?line false = path(G, a, a), - ?line false = digraph_utils:topsort(G), - ?line false = digraph_utils:is_acyclic(G), - ?line ok = eval(digraph_utils:loop_vertices(G), [h,i]), - ?line ok = eval(digraph_utils:reaching([e], G), [e,f,g]), - ?line ok = eval(digraph_utils:reaching_neighbours([e], G), [e,f,g]), - ?line ok = eval(digraph_utils:reachable([e], G), [e,f,g]), - ?line ok = eval(digraph_utils:reachable_neighbours([e], G), [e,f,g]), - ?line ok = eval(digraph_utils:reaching([b], G), [b]), - ?line ok = eval(digraph_utils:reaching_neighbours([b], G), []), - ?line ok = eval(digraph_utils:reachable([b], G), [b,c,d]), - ?line ok = eval(digraph_utils:reachable_neighbours([b], G), [c,d]), - ?line ok = eval(digraph_utils:reaching([h], G), [h]), - ?line ok = eval(digraph_utils:reaching_neighbours([h], G), [h]), - ?line ok = eval(digraph_utils:reachable([h], G), [h]), - ?line ok = eval(digraph_utils:reachable_neighbours([h], G), [h]), - ?line ok = eval(digraph_utils:reachable([e,f], G), [e,f,g]), - ?line ok = eval(digraph_utils:reachable_neighbours([e,f], G), [e,f,g]), - ?line ok = eval(digraph_utils:reachable([h,h,h], G), [h]), - ?line true = digraph:delete(G), + ok = evall(digraph_utils:cyclic_strong_components(G), + [[e,f,g],[h],[i]]), + true = path(G, e, e), + false = path(G, e, j), + false = path(G, a, a), + false = digraph_utils:topsort(G), + false = digraph_utils:is_acyclic(G), + ok = eval(digraph_utils:loop_vertices(G), [h,i]), + ok = eval(digraph_utils:reaching([e], G), [e,f,g]), + ok = eval(digraph_utils:reaching_neighbours([e], G), [e,f,g]), + ok = eval(digraph_utils:reachable([e], G), [e,f,g]), + ok = eval(digraph_utils:reachable_neighbours([e], G), [e,f,g]), + ok = eval(digraph_utils:reaching([b], G), [b]), + ok = eval(digraph_utils:reaching_neighbours([b], G), []), + ok = eval(digraph_utils:reachable([b], G), [b,c,d]), + ok = eval(digraph_utils:reachable_neighbours([b], G), [c,d]), + ok = eval(digraph_utils:reaching([h], G), [h]), + ok = eval(digraph_utils:reaching_neighbours([h], G), [h]), + ok = eval(digraph_utils:reachable([h], G), [h]), + ok = eval(digraph_utils:reachable_neighbours([h], G), [h]), + ok = eval(digraph_utils:reachable([e,f], G), [e,f,g]), + ok = eval(digraph_utils:reachable_neighbours([e,f], G), [e,f,g]), + ok = eval(digraph_utils:reachable([h,h,h], G), [h]), + true = digraph:delete(G), ok. loop(Config) when is_list(Config) -> - ?line G = digraph:new(), - ?line add_vertices(G, [a,b]), - ?line add_edges(G, [{a,a},{b,b}]), - ?line ok = evall(digraph_utils:components(G), [[a],[b]]), - ?line ok = evall(digraph_utils:strong_components(G), [[a],[b]]), - ?line ok = evall(digraph_utils:cyclic_strong_components(G), [[a],[b]]), - ?line [_,_] = digraph_utils:topsort(G), - ?line false = digraph_utils:is_acyclic(G), - ?line ok = eval(digraph_utils:loop_vertices(G), [a,b]), - ?line [_,_] = digraph_utils:preorder(G), - ?line [_,_] = digraph_utils:postorder(G), - ?line ok = eval(digraph_utils:reaching([b], G), [b]), - ?line ok = eval(digraph_utils:reaching_neighbours([b], G), [b]), - ?line ok = eval(digraph_utils:reachable([b], G), [b]), - ?line ok = eval(digraph_utils:reachable_neighbours([b], G), [b]), - ?line true = path(G, a, a), - ?line true = digraph:delete(G), + G = digraph:new(), + add_vertices(G, [a,b]), + add_edges(G, [{a,a},{b,b}]), + ok = evall(digraph_utils:components(G), [[a],[b]]), + ok = evall(digraph_utils:strong_components(G), [[a],[b]]), + ok = evall(digraph_utils:cyclic_strong_components(G), [[a],[b]]), + [_,_] = digraph_utils:topsort(G), + false = digraph_utils:is_acyclic(G), + ok = eval(digraph_utils:loop_vertices(G), [a,b]), + [_,_] = digraph_utils:preorder(G), + [_,_] = digraph_utils:postorder(G), + ok = eval(digraph_utils:reaching([b], G), [b]), + ok = eval(digraph_utils:reaching_neighbours([b], G), [b]), + ok = eval(digraph_utils:reachable([b], G), [b]), + ok = eval(digraph_utils:reachable_neighbours([b], G), [b]), + true = path(G, a, a), + true = digraph:delete(G), ok. isolated(Config) when is_list(Config) -> - ?line G = digraph:new(), - ?line add_vertices(G, [a,b]), - ?line ok = evall(digraph_utils:components(G), [[a],[b]]), - ?line ok = evall(digraph_utils:strong_components(G), [[a],[b]]), - ?line ok = evall(digraph_utils:cyclic_strong_components(G), []), - ?line [_,_] = digraph_utils:topsort(G), - ?line true = digraph_utils:is_acyclic(G), - ?line ok = eval(digraph_utils:loop_vertices(G), []), - ?line [_,_] = digraph_utils:preorder(G), - ?line [_,_] = digraph_utils:postorder(G), - ?line ok = eval(digraph_utils:reaching([b], G), [b]), - ?line ok = eval(digraph_utils:reaching_neighbours([b], G), []), - ?line ok = eval(digraph_utils:reachable([b], G), [b]), - ?line ok = eval(digraph_utils:reachable_neighbours([b], G), []), - ?line false = path(G, a, a), - ?line true = digraph:delete(G), + G = digraph:new(), + add_vertices(G, [a,b]), + ok = evall(digraph_utils:components(G), [[a],[b]]), + ok = evall(digraph_utils:strong_components(G), [[a],[b]]), + ok = evall(digraph_utils:cyclic_strong_components(G), []), + [_,_] = digraph_utils:topsort(G), + true = digraph_utils:is_acyclic(G), + ok = eval(digraph_utils:loop_vertices(G), []), + [_,_] = digraph_utils:preorder(G), + [_,_] = digraph_utils:postorder(G), + ok = eval(digraph_utils:reaching([b], G), [b]), + ok = eval(digraph_utils:reaching_neighbours([b], G), []), + ok = eval(digraph_utils:reachable([b], G), [b]), + ok = eval(digraph_utils:reachable_neighbours([b], G), []), + false = path(G, a, a), + true = digraph:delete(G), ok. topsort(Config) when is_list(Config) -> - ?line G = digraph:new(), - ?line add_edges(G, [{a,b},{b,c},{c,d},{d,e},{e,f}]), - ?line ok = eval(digraph_utils:topsort(G), [a,b,c,d,e,f]), - ?line true = digraph:delete(G), + G = digraph:new(), + add_edges(G, [{a,b},{b,c},{c,d},{d,e},{e,f}]), + ok = eval(digraph_utils:topsort(G), [a,b,c,d,e,f]), + true = digraph:delete(G), ok. subgraph(Config) when is_list(Config) -> - ?line G = digraph:new([acyclic]), - ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, - {h,h},{i,i},{i,j}]), - ?line add_vertices(G, [{b,bl},{f,fl}]), - ?line SG = digraph_utils:subgraph(G, [u1,b,c,u2,f,g,i,u3]), - ?line [b,c,f,g,i] = lists:sort(digraph:vertices(SG)), - ?line {b,bl} = digraph:vertex(SG, b), - ?line {c,[]} = digraph:vertex(SG, c), - ?line {fg,f,g,fgl} = digraph:edge(SG, fg), - ?line {fg2,f,g,fgl2} = digraph:edge(SG, fg2), - ?line {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG)), - ?line true = digraph:delete(SG), - - ?line SG1 = digraph_utils:subgraph(G, [f, g, h], - [{type, []}, {keep_labels, false}]), - ?line [f,g,h] = lists:sort(digraph:vertices(SG1)), - ?line {f,[]} = digraph:vertex(SG1, f), - ?line {fg,f,g,[]} = digraph:edge(SG1, fg), - ?line {_, {_, cyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG1)), - ?line true = digraph:delete(SG1), - - ?line SG2 = digraph_utils:subgraph(G, [f, g, h], - [{type, [acyclic]}, - {keep_labels, true}]), - ?line [f,g,h] = lists:sort(digraph:vertices(SG2)), - ?line {f,fl} = digraph:vertex(SG2, f), - ?line {fg,f,g,fgl} = digraph:edge(SG2, fg), - ?line {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG2)), - ?line true = digraph:delete(SG2), - - ?line {'EXIT',{badarg,_}} = + G = digraph:new([acyclic]), + add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, + {h,h},{i,i},{i,j}]), + add_vertices(G, [{b,bl},{f,fl}]), + SG = digraph_utils:subgraph(G, [u1,b,c,u2,f,g,i,u3]), + [b,c,f,g,i] = lists:sort(digraph:vertices(SG)), + {b,bl} = digraph:vertex(SG, b), + {c,[]} = digraph:vertex(SG, c), + {fg,f,g,fgl} = digraph:edge(SG, fg), + {fg2,f,g,fgl2} = digraph:edge(SG, fg2), + {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG)), + true = digraph:delete(SG), + + SG1 = digraph_utils:subgraph(G, [f, g, h], + [{type, []}, {keep_labels, false}]), + [f,g,h] = lists:sort(digraph:vertices(SG1)), + {f,[]} = digraph:vertex(SG1, f), + {fg,f,g,[]} = digraph:edge(SG1, fg), + {_, {_, cyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG1)), + true = digraph:delete(SG1), + + SG2 = digraph_utils:subgraph(G, [f, g, h], + [{type, [acyclic]}, + {keep_labels, true}]), + [f,g,h] = lists:sort(digraph:vertices(SG2)), + {f,fl} = digraph:vertex(SG2, f), + {fg,f,g,fgl} = digraph:edge(SG2, fg), + {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG2)), + true = digraph:delete(SG2), + + {'EXIT',{badarg,_}} = (catch digraph_utils:subgraph(G, [f], [{invalid, opt}])), - ?line {'EXIT',{badarg,_}} = + {'EXIT',{badarg,_}} = (catch digraph_utils:subgraph(G, [f], [{keep_labels, not_Bool}])), - ?line {'EXIT',{badarg,_}} = + {'EXIT',{badarg,_}} = (catch digraph_utils:subgraph(G, [f], [{type, not_type}])), - ?line {'EXIT',{badarg,_}} = + {'EXIT',{badarg,_}} = (catch digraph_utils:subgraph(G, [f], [{type, [not_type]}])), - ?line {'EXIT',{badarg,_}} = + {'EXIT',{badarg,_}} = (catch digraph_utils:subgraph(G, [f], not_a_list)), - ?line true = digraph:delete(G), + true = digraph:delete(G), ok. condensation(Config) when is_list(Config) -> - ?line G = digraph:new([]), - ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, - {h,h},{j,i},{i,j}]), - ?line add_vertices(G, [q]), - ?line CG = digraph_utils:condensation(G), - ?line Vs = sort_2(digraph:vertices(CG)), - ?line [[b],[c],[d],[e,f,g],[h],[i,j],[q]] = Vs, - ?line Fun = fun(E) -> - {_E, V1, V2, _L} = digraph:edge(CG, E), - {lists:sort(V1), lists:sort(V2)} - end, - ?line Es = lists:map(Fun, digraph:edges(CG)), - ?line [{[b],[c]},{[b],[d]}] = lists:sort(Es), - ?line true = digraph:delete(CG), - ?line true = digraph:delete(G), + G = digraph:new([]), + add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e}, + {h,h},{j,i},{i,j}]), + add_vertices(G, [q]), + CG = digraph_utils:condensation(G), + Vs = sort_2(digraph:vertices(CG)), + [[b],[c],[d],[e,f,g],[h],[i,j],[q]] = Vs, + Fun = fun(E) -> + {_E, V1, V2, _L} = digraph:edge(CG, E), + {lists:sort(V1), lists:sort(V2)} + end, + Es = lists:map(Fun, digraph:edges(CG)), + [{[b],[c]},{[b],[d]}] = lists:sort(Es), + true = digraph:delete(CG), + true = digraph:delete(G), ok. %% OTP-7081 tree(Config) when is_list(Config) -> - ?line false = is_tree([], []), - ?line true = is_tree([a], []), - ?line false = is_tree([a,b], []), - ?line true = is_tree([{a,b}]), - ?line false = is_tree([{a,b},{b,a}]), - ?line true = is_tree([{a,b},{a,c},{b,d},{b,e}]), - ?line false = is_tree([{a,b},{a,c},{b,d},{b,e}, {d,e}]), - ?line false = is_tree([{a,b},{a,c},{b,d},{b,e}, {b,e}]), - ?line true = is_tree([{a,c},{c,b}]), - ?line true = is_tree([{b,a},{c,a}]), + false = is_tree([], []), + true = is_tree([a], []), + false = is_tree([a,b], []), + true = is_tree([{a,b}]), + false = is_tree([{a,b},{b,a}]), + true = is_tree([{a,b},{a,c},{b,d},{b,e}]), + false = is_tree([{a,b},{a,c},{b,d},{b,e}, {d,e}]), + false = is_tree([{a,b},{a,c},{b,d},{b,e}, {b,e}]), + true = is_tree([{a,c},{c,b}]), + true = is_tree([{b,a},{c,a}]), %% Parallel edges. Acyclic and with one componets %% (according to the digraph module). - ?line false = is_tree([{a,b},{a,b}]), - - ?line no = arborescence_root([], []), - ?line {yes, a} = arborescence_root([a], []), - ?line no = arborescence_root([a,b], []), - ?line {yes, a} = arborescence_root([{a,b}]), - ?line no = arborescence_root([{a,b},{b,a}]), - ?line {yes, a} = arborescence_root([{a,b},{a,c},{b,d},{b,e}]), - ?line no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {d,e}]), - ?line no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {b,e}]), - ?line {yes, a} = arborescence_root([{a,c},{c,b}]), - ?line no = arborescence_root([{b,a},{c,a}]), - - ?line false = is_arborescence([], []), - ?line true = is_arborescence([a], []), - ?line false = is_arborescence([a,b], []), - ?line true = is_arborescence([{a,b}]), - ?line false = is_arborescence([{a,b},{b,a}]), - ?line true = is_arborescence([{a,b},{a,c},{b,d},{b,e}]), - ?line false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {d,e}]), - ?line false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {b,e}]), - ?line true = is_arborescence([{a,c},{c,b}]), - ?line false = is_arborescence([{b,a},{c,a}]), + false = is_tree([{a,b},{a,b}]), + + no = arborescence_root([], []), + {yes, a} = arborescence_root([a], []), + no = arborescence_root([a,b], []), + {yes, a} = arborescence_root([{a,b}]), + no = arborescence_root([{a,b},{b,a}]), + {yes, a} = arborescence_root([{a,b},{a,c},{b,d},{b,e}]), + no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {d,e}]), + no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {b,e}]), + {yes, a} = arborescence_root([{a,c},{c,b}]), + no = arborescence_root([{b,a},{c,a}]), + + false = is_arborescence([], []), + true = is_arborescence([a], []), + false = is_arborescence([a,b], []), + true = is_arborescence([{a,b}]), + false = is_arborescence([{a,b},{b,a}]), + true = is_arborescence([{a,b},{a,c},{b,d},{b,e}]), + false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {d,e}]), + false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {b,e}]), + true = is_arborescence([{a,c},{c,b}]), + false = is_arborescence([{b,a},{c,a}]), %% Parallel edges. - ?line false = is_arborescence([{a,b},{a,b}]), + false = is_arborescence([{a,b},{a,b}]), ok. @@ -312,7 +312,7 @@ eval(L, E) -> evall(L, E) -> F = fun(L1) -> lists:sort(L1) end, Fun = fun(LL) -> F(lists:map(F, LL)) end, - + Expected = Fun(E), Got = Fun(L), if -- cgit v1.2.3 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- lib/stdlib/test/digraph_utils_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/stdlib/test/digraph_utils_SUITE.erl') diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 23520072f8..1dda4d6624 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2012. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. -- cgit v1.2.3