瀏覽代碼

reorder tests

master
Archivist 6 年之前
父節點
當前提交
ed354bc231
共有 1 個文件被更改,包括 11 次插入11 次删除
  1. +11
    -11
      spec/crystal-scatter_spec.cr

+ 11
- 11
spec/crystal-scatter_spec.cr 查看文件

@ -3,6 +3,17 @@ require "./spec_helper"
describe Crystal::Scatter do
# TODO: Write tests
it "add elements to RingGraphs" do
rg = Crystal::Scatter::RingGraph.new
rg.add(UInt64.new(1),[0,0,0,0,0,0],"OSD0")
rg.add(UInt64.new(1),[0,0,0,0,0,1],"OSD1")
rg.add(UInt64.new(1),[0,0,0,0,1,0],"OSD2")
rg.get_weight.should eq(3)
rg.generate_ring(BigRational.new(1))
rg[0][0][0][0][0][0].range_effector.not_nil!.[0].should eq(0)
rg[0][0][0][0][1][0].range_effector.not_nil!.[1].should eq(UInt64::MAX)
end
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")
@ -18,17 +29,6 @@ describe Crystal::Scatter do
end
end
it "add elements to RingGraphs" do
rg = Crystal::Scatter::RingGraph.new
rg.add(UInt64.new(1),[0,0,0,0,0,0],"OSD0")
rg.add(UInt64.new(1),[0,0,0,0,0,1],"OSD1")
rg.add(UInt64.new(1),[0,0,0,0,1,0],"OSD2")
rg.get_weight.should eq(3)
rg.generate_ring(BigRational.new(1))
rg[0][0][0][0][0][0].range_effector.not_nil!.[0].should eq(0)
rg[0][0][0][0][1][0].range_effector.not_nil!.[1].should eq(UInt64::MAX)
end
it "hashes data fast" do
v = Crystal::Scatter::MetaRing.new(3)
time = Time.now

Loading…
取消
儲存