blob: 95a093e54d86aa7969fce9402659d8713db5d3dc [file] [log] [blame]
Ed Tanousc5ba4c22022-02-07 09:59:55 -08001#include "registries.hpp"
2
Nan Zhoud5c80ad2022-07-11 01:16:31 +00003#include <gtest/gtest.h> // IWYU pragma: keep
4
5// IWYU pragma: no_include <gtest/gtest-message.h>
6// IWYU pragma: no_include <gtest/gtest-test-part.h>
7// IWYU pragma: no_include "gtest/gtest_pred_impl.h"
Ed Tanousc5ba4c22022-02-07 09:59:55 -08008
Nan Zhou38ead5e2022-07-03 23:07:27 +00009namespace redfish::registries
10{
11namespace
12{
13
Nan Zhou7ea46432022-07-03 23:55:10 +000014TEST(FillMessageArgs, ArgsAreFilledCorrectly)
Ed Tanousc5ba4c22022-02-07 09:59:55 -080015{
Ed Tanous80f595e2022-02-14 09:32:05 -080016 EXPECT_EQ(fillMessageArgs({{"foo"}}, "%1"), "foo");
17 EXPECT_EQ(fillMessageArgs({}, ""), "");
18 EXPECT_EQ(fillMessageArgs({{"foo", "bar"}}, "%1, %2"), "foo, bar");
19 EXPECT_EQ(fillMessageArgs({{"foo"}}, "%1 bar"), "foo bar");
20 EXPECT_EQ(fillMessageArgs({}, "%1"), "");
21 EXPECT_EQ(fillMessageArgs({}, "%"), "");
22 EXPECT_EQ(fillMessageArgs({}, "%foo"), "");
Ed Tanousc5ba4c22022-02-07 09:59:55 -080023}
Nan Zhou38ead5e2022-07-03 23:07:27 +000024} // namespace
Ed Tanous80f595e2022-02-14 09:32:05 -080025} // namespace redfish::registries