Sha256: 92ac83f636794c66dabf3a43ffaa7b311133b1f3020f148837353bdeebdf5945

Contents?: true

Size: 524 Bytes

Versions: 27

Compression:

Stored size: 524 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

27 entries across 27 versions & 1 rubygems

Version Path
epitools-0.5.136 spec/lcs_spec.rb
epitools-0.5.134 spec/lcs_spec.rb
epitools-0.5.133 spec/lcs_spec.rb
epitools-0.5.131 spec/lcs_spec.rb
epitools-0.5.130 spec/lcs_spec.rb
epitools-0.5.129 spec/lcs_spec.rb
epitools-0.5.128 spec/lcs_spec.rb
epitools-0.5.126 spec/lcs_spec.rb
epitools-0.5.125 spec/lcs_spec.rb
epitools-0.5.124 spec/lcs_spec.rb
epitools-0.5.123 spec/lcs_spec.rb
epitools-0.5.122 spec/lcs_spec.rb
epitools-0.5.121 spec/lcs_spec.rb
epitools-0.5.119 spec/lcs_spec.rb
epitools-0.5.118 spec/lcs_spec.rb
epitools-0.5.116 spec/lcs_spec.rb
epitools-0.5.115 spec/lcs_spec.rb
epitools-0.5.114 spec/lcs_spec.rb
epitools-0.5.113 spec/lcs_spec.rb
epitools-0.5.112 spec/lcs_spec.rb