aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_hashring_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util_hashring_spec.lua')
-rw-r--r--spec/util_hashring_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/util_hashring_spec.lua b/spec/util_hashring_spec.lua
index d8801774..4f6ec3a3 100644
--- a/spec/util_hashring_spec.lua
+++ b/spec/util_hashring_spec.lua
@@ -1,6 +1,7 @@
local hashring = require "util.hashring";
describe("util.hashring", function ()
+ randomize(false);
local sha256 = require "util.hashes".sha256;
@@ -82,4 +83,11 @@ describe("util.hashring", function ()
end
end);
+ it("should support values associated with nodes", function ()
+ local r = hashring.new(128, sha256);
+ r:add_node("node1", { a = 1 });
+ local node, value = r:get_node("foo");
+ assert.is_equal("node1", node);
+ assert.same({ a = 1 }, value);
+ end);
end);