diff --git a/applications/test/wordRe/Test-wordRe.C b/applications/test/wordRe/Test-wordRe.C index ca05244c5e..8917e84764 100644 --- a/applications/test/wordRe/Test-wordRe.C +++ b/applications/test/wordRe/Test-wordRe.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -36,6 +36,7 @@ Description #include "keyType.H" #include "wordRes.H" #include "predicates.H" +#include "Random.H" using namespace Foam; @@ -139,6 +140,34 @@ int main(int argc, char *argv[]) Info<< "string match: " << string("x.*")("xyz") << nl; Info<< "string match: " << string("x.*")(keyre) << nl; + + // Test uniq + { + Random rnd; + const label last = wres1.size()-1; + + for (label i = 0; i < 8; ++i) + { + // Make a copy + wordRe wre(wres1[rnd.position