-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vincentchu
committed
Sep 21, 2011
1 parent
573f984
commit e53752a
Showing
4 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'spec_helper' | ||
|
||
describe FuzzBall::DupleIndex do | ||
before(:each) do | ||
@index = FuzzBall::DupleIndex.new | ||
end | ||
|
||
describe "#add" do | ||
it "should be able to add a string" do | ||
lambda { | ||
@index.add(0, [1, 2, 3]); | ||
}.should_not raise_exception | ||
end | ||
end | ||
|
||
describe "#query" do | ||
before(:each) do | ||
@index.add(0, [1, 2, 3]); | ||
@index.add(1, [0, 1, 2]); | ||
@index.add(2, [3, 4, 3, 4, 3, 4]) | ||
end | ||
|
||
it "should tell you where a given duple is found" do | ||
@index.query(1, 2).should == [[1, 1], [0, 0]] | ||
end | ||
end | ||
end |