X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_paranoia.cpp;h=af36238bbe9889688772901704cf80c68178a0d0;hp=7a89f9de19e90943dc916a6922f01226690b4af7;hb=7805dc0c2358b7774ad08cd443cd945cbd940749;hpb=be11202909f8014b213065ca85272af403a530f1 diff --git a/check/exam_paranoia.cpp b/check/exam_paranoia.cpp index 7a89f9de..af36238b 100644 --- a/check/exam_paranoia.cpp +++ b/check/exam_paranoia.cpp @@ -638,6 +638,27 @@ unsigned exam_paranoia26() return result; } +// Bug in collect() +// cf. https://www.ginac.de/pipermail/ginac-list/2021-March/002337.html +static unsigned exam_collect_multiply_referenced_lst() +{ + unsigned result = 0; + symbol x("x"), y("y"); + ex a = x + y; + ex l = lst{x, y}; + ex l2 = l; // make l a multiply referenced object + + try { + ex b = collect(a, l); + } catch (const std::runtime_error & e) { + clog << "collect(" << ", " << l << ") threw a runtime_error(" + << e.what() << ")" << endl; + ++result; + } + + return result; +} + unsigned exam_paranoia() { unsigned result = 0; @@ -672,6 +693,7 @@ unsigned exam_paranoia() result += exam_paranoia24(); cout << '.' << flush; result += exam_paranoia25(); cout << '.' << flush; result += exam_paranoia26(); cout << '.' << flush; + result += exam_collect_multiply_referenced_lst(); cout << '.' << flush; return result; }