On Windows the Regex matcher for '.' does not match '\n'

Thus we have to use ContainsRegex instead of MatchesRegex
This commit is contained in:
Axel Kohlmeyer
2022-01-29 16:35:30 -05:00
parent d62e25decc
commit 845ab2dd71
13 changed files with 52 additions and 57 deletions

View File

@ -36,7 +36,7 @@ using LAMMPS_NS::utils::split_words;
namespace LAMMPS_NS {
using ::testing::ExitedWithCode;
using ::testing::MatchesRegex;
using ::testing::ContainsRegex;
using ::testing::StrEq;
class LatticeRegionTest : public LAMMPSTest {
@ -82,7 +82,7 @@ TEST_F(LatticeRegionTest, lattice_sc)
BEGIN_CAPTURE_OUTPUT();
command("lattice sc 1.0 spacing 1.5 2.0 3.0");
auto output = END_CAPTURE_OUTPUT();
ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 1.5.* 2.* 3.*"));
ASSERT_THAT(output, ContainsRegex(".*Lattice spacing in x,y,z = 1.5.* 2.* 3.*"));
auto lattice = lmp->domain->lattice;
ASSERT_EQ(lattice->xlattice, 1.5);
@ -92,7 +92,7 @@ TEST_F(LatticeRegionTest, lattice_sc)
BEGIN_CAPTURE_OUTPUT();
command("lattice sc 2.0");
output = END_CAPTURE_OUTPUT();
ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 2.* 2.* 2.*"));
ASSERT_THAT(output, ContainsRegex(".*Lattice spacing in x,y,z = 2.* 2.* 2.*"));
lattice = lmp->domain->lattice;
ASSERT_EQ(lattice->style, Lattice::SC);