File 1881-digraph-document-functions-source_vertices-1-and-sin.patch of Package erlang

From 49b6fcf5080744fd97ff3bfcdbcf34056890ea2d Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Mon, 12 Jan 2026 13:22:32 +0100
Subject: [PATCH 1/3] digraph: document functions source_vertices/1 and
 sink_vertices/1

---
 lib/stdlib/src/digraph.erl        | 12 ++++++++++--
 lib/stdlib/test/digraph_SUITE.erl |  5 +----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lib/stdlib/src/digraph.erl b/lib/stdlib/src/digraph.erl
index 8806a812eb..13dd54b7e7 100644
--- a/lib/stdlib/src/digraph.erl
+++ b/lib/stdlib/src/digraph.erl
@@ -324,13 +324,21 @@ no_vertices(G) ->
 vertices(G) ->
     ets:select(G#digraph.vtab, [{{'$1', '_'}, [], ['$1']}]).
 
--doc false.
+-doc """
+Returns a list of all vertices of graph `G` with
+[in-degree](`m:graph#in_degree`) zero.
+""".
+-doc(#{ since => ~"OTP 29.0"}).
 -spec source_vertices(graph()) -> [vertex()].
 
 source_vertices(G) ->
     collect_vertices(G, in).
 
--doc false.
+-doc """
+Returns a list of all vertices of graph `G` with
+[out-degree](`m:graph#in_degree`) zero.
+""".
+-doc(#{ since => ~"OTP 29.0"}).
 -spec sink_vertices(graph()) -> [vertex()].
 
 sink_vertices(G) ->
diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl
index 72deb18c4e..d23511bf0e 100644
--- a/lib/stdlib/test/digraph_SUITE.erl
+++ b/lib/stdlib/test/digraph_SUITE.erl
@@ -488,9 +488,6 @@ sane1(G) ->
               end
       end, EVs),
 
-    %% sink_vertices and source_vertices were introduced in 2001. They
-    %% are not documented.
-
     %% sink: a vertex with no outgoing edges
     SinkVs = [V || V <- Vs, digraph:out_edges(G, V) =:= [] ],
     case lists:sort(SinkVs) =:=  lists:sort(digraph:sink_vertices(G)) of
@@ -498,7 +495,7 @@ sane1(G) ->
         false -> 
             io:format("Bad sinks~n"), put(sane, no)
     end,
-    %% sink: a vertex with no incoming edges
+    %% source: a vertex with no incoming edges
     SourceVs = [V || V <- Vs, digraph:in_edges(G, V) =:= [] ],
     case lists:sort(SourceVs) =:=  lists:sort(digraph:source_vertices(G)) of
         true -> ok;
-- 
2.51.0

openSUSE Build Service is sponsored by