File: testdiff.rb

package info (click to toggle)
docdiff 0.4.0-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,196 kB
  • sloc: ruby: 12,810; makefile: 102; lisp: 33
file content (35 lines) | stat: -rwxr-xr-x 722 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require "docdiff/diff"
require "pp"

#a = "Hi, I am matz.  I am Ruby's father.".split
#b = "Hello, I am eban.  I am just another Ruby porter.".split

a = [:a, :b, :c, :d, :e, :f, :g, :h, :i, :j]
b = a.reverse
b = [:a, :b, :x, :y, :e, :f, :g, :h, :i, :j]

diff = Diff.new(a, b)
#pp a
#pp b
#pp diff.lcs(:speculative)
#diff.ses(:speculative)
diff.ses(:contours)
#diff.ses(:shortestpath)

=begin
pp diff.lcs(:shortestpath)
pp diff.ses(:shortestpath)

pp diff.lcs(:shortestpath)
pp diff.ses(:shortestpath)
=end

=begin
a = "Hi, I am matz.  I am Ruby's father.".split(//)
b = "Hello, I am eban.  I am just another Ruby porter.".split(//)
diff = Diff.new(a, b)
pp a
pp b
pp diff.lcs(:speculative)
pp diff.ses(:speculative)
=end