Branch: Tag:

1999-05-31

1999-05-31 18:45:45 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bugs in diff3.

Rev: lib/modules/Array.pmod:1.28
Rev: src/testsuite.in:1.171

1: - stest_true([["$Id: testsuite.in,v 1.170 1999/05/26 07:09:07 hubbe Exp $"]]) + stest_true([["$Id: testsuite.in,v 1.171 1999/05/31 18:45:45 mast Exp $"]])   cond([[all_constants()->_verify_internals]],   [[    test_do(_verify_internals())
2513:    ({({({"a"}),({"c"}),({"d"}),({ })}),    ({({"a"}),({ }),({"d"}),({"d"})}),    ({({"a"}),({"b"}),({ }),({ })})})) + test_equal(Array.diff3(({"a","b","c"}),({"b","e","c"}),({"b","e","c"})), +  ({({({"a"}),({"b"}),({ }),({"c"})}), +  ({({ }),({"b"}),({"e"}),({"c"})}), +  ({({ }),({"b"}),({"e"}),({"c"})})}))   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(({"y","b","c","x"}),({"y","c","a"}),({"a","b","x"})), +  ({({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"y"}),({ }),({"c"}),({"a"})}), +  ({({"a"}),({"b"}),({ }),({"x"})})})) + test_equal(Array.diff3(({"y","b","c","x"}),({"a","b","x"}),({"y","c","a"})), +  ({({({"y"}),({"b"}),({"c"}),({"x"})}), +  ({({"a"}),({"b"}),({ }),({"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"})})})) -  + // The following is not optimal. + test_equal(Array.diff3(({"a","x","b","c"}),({"b","x","c"}),({"b","x","c"})), +  ({({({"a","x"}),({"b"}),({ }),({"c"})}), +  ({({ }),({"b"}),({"x"}),({"c"})}), +  ({({ }),({"b"}),({"x"}),({"c"})})})) + test_equal(Array.diff3(({"x","x","a","x"}),({"a","x","b","x"}),({"a","x","b","x"})), +  ({({({"x","x"}),({"a","x"}),({ })}), +  ({({ }),({"a","x"}),({"b","x"})}), +  ({({ }),({"a","x"}),({"b","x"})})}))   test_equal(Array.diff3(({"a","a","b"}),({"b","c"}),({"c","a","a"})),    ({({({ }),({ }),({"a","a"}),({"b"})}),    ({({"b"}),({"c"}),({ }),({ })}),
2557:    ({({({"a"}),({"b"}),({"c"}),({"d"}),({ }),({ }),({ })}),    ({({ }),({"b"}),({ }),({ }),({ }),({"a"}),({"c","c"})}),    ({({ }),({"b"}),({"b"}),({"d"}),({"d"}),({"a"}),({ })})})) + // The following is not optimal.   test_equal(Array.diff3(({"a"}),({"b","a"}),({"a","b","a"})), -  ({({({ }),({ }),({"a"})}), -  ({({ }),({"b"}),({"a"})}), -  ({({"a"}),({"b"}),({"a"})})})) +  ({({({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({"b","a"})})})) + // The following is not optimal.   test_equal(Array.diff3(({"a","c"}),({"b","a","c"}),({"a","c","b","a","c"})), -  ({({({ }),({ }),({"a","c"})}), -  ({({ }),({"b"}),({"a","c"})}), -  ({({"a","c"}),({"b"}),({"a","c"})})})) +  ({({({ }),({"a","c"}),({ })}), +  ({({"b"}),({"a","c"}),({ })}), +  ({({ }),({"a","c"}),({"b","a","c"})})})) + // The following is not optimal.   test_equal(Array.diff3(({"a","d"}),({"b","a","c"}),({"a","c","b","a","c"})), -  ({({({ }),({ }),({"a"}),({"d"})}), -  ({({ }),({"b"}),({"a"}),({"c"})}), -  ({({"a","c"}),({"b"}),({"a"}),({"c"})})})) +  ({({({ }),({"a"}),({"d" }),({ })}), +  ({({"b"}),({"a"}),({ }),({"c"})}), +  ({({ }),({"a"}),({"c","b","a"}),({"c"})})})) + // The following is not optimal.   test_equal(Array.diff3(({"a","a"}),({"b","a","d","a"}),({"a","a","b","a","a"})), -  ({({({ }),({ }),({"a"}),({ }),({"a"})}), -  ({({ }),({"b"}),({"a"}),({"d"}),({"a"})}), -  ({({"a","a"}),({"b"}),({"a"}),({ }),({"a"})})})) +  ({({({ }),({"a"}),({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({"d"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ }),({"a"}),({"b","a","a"})})})) + test_equal(Array.diff3(({"a"}),({"a","b"}),({"b","a"})), +  ({({({ }),({"a"}),({ })}), +  ({({ }),({"a"}),({"b"})}), +  ({({"b"}),({"a"}),({ })})})) + test_equal(Array.diff3(({"a","b"}),({"b","a"}),({"a"})), +  ({({({ }),({"a"}),({"b"})}), +  ({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ })})})) + test_equal(Array.diff3(({"b","a"}),({"a"}),({"a","b"})), +  ({({({"b"}),({"a"}),({ })}), +  ({({ }),({"a"}),({ })}), +  ({({ }),({"a"}),({"b"})})})) + test_equal(Array.diff3(({"a","b"}),({"a"}),({"b","a"})), +  ({({({ }),({"a"}),({"b"})}), +  ({({ }),({"a"}),({ })}), +  ({({"b"}),({"a"}),({ })})})) + test_equal(Array.diff3(({"a","c"}),({"a","c","b","a"}),({"b","a","c"})), +  ({({({ }),({"a","c"}),({ })}), +  ({({ }),({"a","c"}),({"b","a"})}), +  ({({"b"}),({"a","c"}),({ })})})) + test_equal(Array.diff3(({"a","c","b","a"}),({"a","c"}),({"b","a","c"})), +  ({({({ }),({"a","c"}),({"b","a"})}), +  ({({ }),({"a","c"}),({ })}), +  ({({"b"}),({"a","c"}),({ })})}))      // - equal   // equal is already tested by this script