Sha256: a8ae769845cdaddfb3aa20484c5368c247a300fd9a2ce17340294929be67260e

Contents?: true

Size: 538 Bytes

Versions: 159

Compression:

Stored size: 538 Bytes

Contents

require 'epitools/lcs'

describe "Longest common subsequence" do
  
  it "works!" do
    prefix_strings = [
     "shenanigans, gentlemen!",
      "shenanigans has been called",
      "shenanigans: a great restaurant."
    ]
    
    subsequence_strings = [
      "i call shenanigans on you!",
      "shenanigans is a great restaurant.",
      "you like this? shenanigans!"
    ]
  
    longest_common_prefix(prefix_strings).should == "shenanigans"
    longest_common_subsequence(*subsequence_strings[0..1]).should == 12
  end    
  
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
epitools-0.5.103 spec/lcs_spec.rb
epitools-0.5.100 spec/lcs_spec.rb
epitools-0.5.99 spec/lcs_spec.rb
epitools-0.5.98 spec/lcs_spec.rb
epitools-0.5.97 spec/lcs_spec.rb
epitools-0.5.96 spec/lcs_spec.rb
epitools-0.5.95 spec/lcs_spec.rb
epitools-0.5.94 spec/lcs_spec.rb
epitools-0.5.93 spec/lcs_spec.rb
epitools-0.5.92 spec/lcs_spec.rb
epitools-0.5.91 spec/lcs_spec.rb
epitools-0.5.90 spec/lcs_spec.rb
epitools-0.5.89 spec/lcs_spec.rb
epitools-0.5.88 spec/lcs_spec.rb
epitools-0.5.87 spec/lcs_spec.rb
epitools-0.5.86 spec/lcs_spec.rb
epitools-0.5.85 spec/lcs_spec.rb
epitools-0.5.84 spec/lcs_spec.rb
epitools-0.5.83 spec/lcs_spec.rb
epitools-0.5.82 spec/lcs_spec.rb