diff --git a/spec/crystal-scatter_spec.cr b/spec/crystal-scatter_spec.cr index e759233..3ae5c40 100644 --- a/spec/crystal-scatter_spec.cr +++ b/spec/crystal-scatter_spec.cr @@ -3,6 +3,21 @@ require "./spec_helper" describe Crystal::Scatter do # TODO: Write tests + it "slices data into multiple pods" do + mr = Crystal::Scatter::MetaRing.new(3) + mr.add Crystal::Scatter::Daemon.new(1,[0,0,0,0,0,0],"OSD0") + mr.add [Crystal::Scatter::Daemon.new(1,[0,0,0,0,0,1],"OSD1"),Crystal::Scatter::Daemon.new(1,[0,0,0,0,0,2],"OSD2")] + + (1..1000).each do |numb| + slices = mr.get_slices_for(numb.to_s) + set = Set(String).new + slices.each do |sl| + set<