Branch: Tag:

1998-12-02

1998-12-02 12:56:47 by Martin Stjernholm <mast@lysator.liu.se>

diff3 got better heuristics in ambiguous cases.

Rev: lib/modules/Array.pmod:1.25
Rev: src/testsuite.in:1.136

1: - stest_true([["$Id: testsuite.in,v 1.135 1998/12/01 15:23:29 mast Exp $"]]) + stest_true([["$Id: testsuite.in,v 1.136 1998/12/02 12:56:47 mast Exp $"]])   cond([[all_constants()->_verify_internals]],   [[    test_do(_verify_internals())
2255:    ({ ({ ({}), "123.org"/"", ({}) }),    ({ "http://"/"", "123.org"/"", ({ "/" }) }) }))    - // - Array.diff3 (these tests do not work for a really optimal diff3 implementation) - test_equal(Array.diff3(({" "}),({"a"}),({"b"})), -  ({({({" "})}), -  ({({"a"})}), -  ({({"b"})})})) - test_equal(Array.diff3(({}),({"a"}),({"b"})), -  ({({({ })}), -  ({({"a"})}), -  ({({"b"})})})) + // - Array.diff3 (note that the results would be different for a really optimal diff3)   test_equal(Array.diff3(({}),({"a","c"}),({"b","y"})),    ({({({ })}),    ({({"a","c"})}),
2276:    ({({({"a"}),({ })}),    ({({"a"}),({"c"})}),    ({({ }),({"b"})})})) - test_equal(Array.diff3(({"a","c","d"}),({"a","d","d"}),({"a","b"})), -  ({({({"a"}),({"c"}),({"d"}),({ })}), -  ({({"a"}),({ }),({"d"}),({"d"})}), -  ({({"a"}),({"b"}),({ }),({ })})})) +    test_equal(Array.diff3(({"a","d"}),({"a","d"}),({"a","b"})),    ({({({"a"}),({"d"})}),    ({({"a"}),({"d"})}),    ({({"a"}),({"b"})})})) - test_equal(Array.diff3(({"a","b"}),({"b","c"}),({"c","a"})), -  ({({({"a"}),({"b"}),({ }),({ })}), -  ({({ }),({"b"}),({"c"}),({ })}), -  ({({ }),({ }),({"c"}),({"a"})})})) +    test_equal(Array.diff3(({"a","b"}),({"b"}),({"c","b"})),    ({({({"a"}),({"b"})}),    ({({ }),({"b"})}),    ({({"c"}),({"b"})})})) -  + // The following is not optimal. + test_equal(Array.diff3(({"a","b"}),({"b"}),({"b","b"})), +  ({({({"a"}),({"b"}),({ })}), +  ({({ }),({"b"}),({ })}), +  ({({ }),({"b"}),({"b"})})})) + test_equal(Array.diff3(({"a","c","d"}),({"a","d","d"}),({"a","b"})), +  ({({({"a"}),({"c"}),({"d"}),({ })}), +  ({({"a"}),({ }),({"d"}),({"d"})}), +  ({({"a"}),({"b"}),({ }),({ })})})) + test_equal(Array.diff3(({"a","b","x"}),({"y","b","c","x"}),({"y","c","a"})), +  ({({({"a"}),({"b"}),({ }),({"x"})}), +  ({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"y"}),({ }),({"c"}),({"a"})})})) + test_equal(Array.diff3(({"a","a","b","b"}),({"b","b","c","c"}),({"c","c","a","a"})), +  ({({({"a","a"}),({"b","b"}),({ }),({ })}), +  ({({ }),({"b","b"}),({"c","c"}),({ })}), +  ({({ }),({ }),({"c","c"}),({"a","a"})})})) + test_equal(Array.diff3(({"a","a","b"}),({"b","c"}),({"c","a","a"})), +  ({({({ }),({ }),({"a","a"}),({"b"})}), +  ({({"b"}),({"c"}),({ }),({ })}), +  ({({ }),({"c"}),({"a","a"}),({ })})})) + test_equal(Array.diff3(({"x","x","x","a"}),({"y","b"}),({"x","x","x","c"})), +  ({({({"x","x","x"}),({"a" })}), +  ({({ }),({"y","b"})}), +  ({({"x","x","x"}),({"c" })})})) + test_equal(Array.diff3(({"a","x","x","x","a"}),({"b","y","y","b"}),({"c","x","x","x","c"})), +  ({({({"a" }),({"x","x","x"}),({"a"})}), +  ({({"b","y","y","b"}),({ }),({ })}), +  ({({"c" }),({"x","x","x"}),({"c"})})}))   test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","d"}),({"a","y","y","y"})),    ({({({"a"}),({"b","c" }),({"d"})}),    ({({ }),({"x","x","x"}),({"d"})}),
2301:    ({({"a"}),({"x","x" }),({"d"})}),    ({({"a"}),({"y","y","y"}),({ })})}))   test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","b"}),({"a","y","y","y"})), -  ({({({"a"}),({ }),({"b"}),({"c","d"})}), -  ({({ }),({"x","x","x"}),({"b"}),({ })}), -  ({({"a"}),({"y","y","y"}),({ }),({ })})})) +  ({({({"a" }),({"b"}),({"c","d" })}), +  ({({"x","x","x"}),({"b"}),({ })}), +  ({({"a" }),({ }),({"y","y","y"})})})) + test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","c"}),({"a","y","y","y"})), +  ({({({"a"}),({"b" }),({"c"}),({"d"})}), +  ({({ }),({"x","x","x"}),({"c"}),({ })}), +  ({({"a"}),({"y","y","y"}),({ }),({ })})}))   test_equal(Array.diff3(({"a","b","b","c","d"}),({"z","a","b","b","x"}),({"z","b","c","x"})),    ({({({ }),({"a"}),({"b"}),({"b"}),({"c"}),({"d"})}),    ({({"z"}),({"a"}),({"b"}),({"b"}),({ }),({"x"})}),