From 986cf913b7798d4cb244847eb0508a3fcafc9aa1 Mon Sep 17 00:00:00 2001 From: Paul Kunysch Date: Sat, 20 Apr 2013 22:09:54 +0200 Subject: Fix pruning of common sequences at start. --- spec/diff_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/diff_spec.rb') diff --git a/spec/diff_spec.rb b/spec/diff_spec.rb index e82ab3d..95d7b40 100644 --- a/spec/diff_spec.rb +++ b/spec/diff_spec.rb @@ -31,6 +31,12 @@ describe "Diff::LCS.diff" do change_diff(correct_diff).should == diff end + it "should correctly diff 'xx' and 'xaxb'" do + left = 'xx' + right = 'xaxb' + Diff::LCS.patch(left, Diff::LCS.diff(left, right)).should == right + end + it "should return an empty diff with (hello, hello)" do Diff::LCS.diff(hello, hello).should == [] end -- cgit v1.2.1