Skip to content

Commit 2a9f5f0

Browse files
committed
[cli] Adapt non-live callback tests to newline end
1 parent e3fd798 commit 2a9f5f0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/unit/test_common_callbacks.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "common.h"
1818
#include "mock_client_platform.h"
1919
#include "mock_client_rpc.h"
20+
#include "multipass/utils.h"
2021
#include "stub_terminal.h"
2122

2223
#include <src/client/cli/cmd/animated_spinner.h>
@@ -26,6 +27,7 @@
2627
#include <sstream>
2728

2829
namespace mp = multipass;
30+
namespace mpu = mp::utils;
2931
namespace mpt = mp::test;
3032
using namespace testing;
3133

@@ -231,7 +233,7 @@ TEST_F(TestSpinnerCallbacks, nonLiveReplySpinnerCallbackPrintsAllMessagesWithout
231233
cb(reply, nullptr);
232234

233235
EXPECT_THAT(err.str(), StrEq(log));
234-
EXPECT_THAT(out.str(), StrEq(msg));
236+
EXPECT_THAT(mpu::trim_end(out.str()), StrEq(msg));
235237
}
236238

237239
TEST_F(TestSpinnerCallbacks, nonLiveIterativeSpinnerCallbackPrintsAllMessagesWithoutSpinnerArtifacts)
@@ -249,5 +251,5 @@ TEST_F(TestSpinnerCallbacks, nonLiveIterativeSpinnerCallbackPrintsAllMessagesWit
249251
cb(reply, nullptr);
250252

251253
EXPECT_THAT(err.str(), StrEq(log));
252-
EXPECT_THAT(out.str(), StrEq(msg));
254+
EXPECT_THAT(mpu::trim_end(out.str()), StrEq(msg));
253255
}

0 commit comments

Comments
 (0)