diff --git a/autotest/RemoveIf/Etalon.log b/autotest/RemoveIf/Etalon.log new file mode 100644 index 000000000..166e5cb9a --- /dev/null +++ b/autotest/RemoveIf/Etalon.log @@ -0,0 +1,7 @@ +* C:\upp\out\autotest\MSBT19.Debug.Debug_Full\RemoveIf.exe 30.10.2020 11:37:43, user: cxl + +x = [1, 4, 5, 5, 7, 5, 2, 1, 7, 9] +x = [1, 4, 5, 5, 7, 5, 2, 1, 7, 9] +x = [1, 4, 5, 5, 7, 5, 2, 1, 7] +x = [1, 4, 7, 2, 1, 7] +x = [] diff --git a/autotest/RemoveIf/RemoveIf.cpp b/autotest/RemoveIf/RemoveIf.cpp new file mode 100644 index 000000000..fef4c2600 --- /dev/null +++ b/autotest/RemoveIf/RemoveIf.cpp @@ -0,0 +1,22 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + StdLogSetup(LOG_COUT|LOG_FILE); + + Vector x { 1, 4, 5, 5, 7, 5, 2, 1, 7, 9 }; + + DUMP(x); + x.RemoveIf([&](int i) { return x[i] == 8; }); + DUMP(x); + x.RemoveIf([&](int i) { return x[i] == 9; }); + DUMP(x); + x.RemoveIf([&](int i) { return x[i] == 5; }); + DUMP(x); + x.RemoveIf([&](int i) { return true; }); + DUMP(x); + + CheckLogEtalon(); +} diff --git a/autotest/RemoveIf/RemoveIf.upp b/autotest/RemoveIf/RemoveIf.upp new file mode 100644 index 000000000..cbb266e5d --- /dev/null +++ b/autotest/RemoveIf/RemoveIf.upp @@ -0,0 +1,10 @@ +uses + Core; + +file + Etalon.log, + RemoveIf.cpp; + +mainconfig + "" = ""; + diff --git a/autotest/StringCompare3/StringCompare3.cpp b/autotest/StringCompare3/StringCompare3.cpp index 09d067bb8..2396e82d2 100644 --- a/autotest/StringCompare3/StringCompare3.cpp +++ b/autotest/StringCompare3/StringCompare3.cpp @@ -32,4 +32,6 @@ CONSOLE_APP_MAIN } LOG("Less: " << less << ", Equal: " << equal); } + + LOG("=================== OK"); }