# # # add_dir "tests/calculation_of_unidiffs_start_of_file" # # add_file "tests/calculation_of_unidiffs_start_of_file/__driver__.lua" # content [10acd94d2d039e77061d78040e0761a7774055d1] # # add_file "tests/calculation_of_unidiffs_start_of_file/firstfile" # content [612ca68d0305c821750a452e9d5bf050e915824f] # # add_file "tests/calculation_of_unidiffs_start_of_file/secondfile" # content [b30f3adf367b5def961bf31e2d5eb9a31d502417] # ============================================================ --- tests/calculation_of_unidiffs_start_of_file/__driver__.lua 10acd94d2d039e77061d78040e0761a7774055d1 +++ tests/calculation_of_unidiffs_start_of_file/__driver__.lua 10acd94d2d039e77061d78040e0761a7774055d1 @@ -0,0 +1,27 @@ +-- -*- lua -*- + +skip_if(not existsonpath("patch")) + +mtn_setup() + +-- get first file and commit to db +get("firstfile", "testfile") +check(mtn("add", "testfile"), 0, false, false) +commit() +rename("testfile", "firstfile") + +-- get second file +get("secondfile", "testfile") + +-- calculate diff to second file using monotone +check(mtn("diff"), 0, true) +canonicalize("stdout") +rename("stdout", "monodiff") +rename("testfile", "secondfile") + +-- see if patch likes that +rename("monodiff", "stdin") +xfail({"patch", "firstfile"}, 0, false, false, true) + +-- see if the resulting file has been properly patched +check(samefile("firstfile", "secondfile")) ============================================================ --- tests/calculation_of_unidiffs_start_of_file/firstfile 612ca68d0305c821750a452e9d5bf050e915824f +++ tests/calculation_of_unidiffs_start_of_file/firstfile 612ca68d0305c821750a452e9d5bf050e915824f @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 ============================================================ --- tests/calculation_of_unidiffs_start_of_file/secondfile b30f3adf367b5def961bf31e2d5eb9a31d502417 +++ tests/calculation_of_unidiffs_start_of_file/secondfile b30f3adf367b5def961bf31e2d5eb9a31d502417 @@ -0,0 +1,11 @@ +1 +2 +3 +4 +5 +6 +inserted +7 +8 +9 +10