You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
507 B

пре 6 година
пре 6 година
  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