您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

16 行
507 B

  1. require "./spec_helper"
  2. describe Crystal::Scatter do
  3. # TODO: Write tests
  4. it "add elements" do
  5. rg = Crystal::Scatter::RingGraph.new
  6. rg.add(UInt64.new(1),[0,0,0,0,0,0],"OSD0")
  7. rg.add(UInt64.new(1),[0,0,0,0,0,1],"OSD1")
  8. rg.add(UInt64.new(1),[0,0,0,0,1,0],"OSD2")
  9. rg.get_weight.should eq(3)
  10. rg.generate_ring(BigRational.new(1))
  11. rg[0][0][0][0][0][0].range_effector.not_nil!.[0].should eq(0)
  12. rg[0][0][0][0][1][0].range_effector.not_nil!.[1].should eq(UInt64::MAX)
  13. end
  14. end