Anonymous committed 6dca045

test max_n and fix a docbug

Comments (0)

Files changed (1)

 % @doc Return either N or the number of partitions in the ring, whichever
-%      is greater.
+%      is lesser.
 % @spec max_n(N :: integer(), CHash :: chash()) -> integer()
 max_n(N, {NumPartitions, _Nodes}) ->
     CHash = chash:fresh(5, the_node),
     ?assertEqual(true, contains_name(the_node,CHash)),
     ?assertEqual(false, contains_name(some_other_node,CHash)).
+max_n_test() ->
+    CHash = chash:fresh(5, the_node),
+    ?assertEqual(1, max_n(1,CHash)),
+    ?assertEqual(5, max_n(7,CHash)).
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.