Lines Matching full:store
1 // Formatting library for C++ - dynamic argument store tests
15 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
16 store.push_back(42); in TEST()
17 store.push_back("abc1"); in TEST()
18 store.push_back(1.5f); in TEST()
19 EXPECT_EQ("42 and abc1 and 1.5", fmt::vformat("{} and {} and {}", store)); in TEST()
24 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
26 store.push_back(str); in TEST()
27 store.push_back(std::cref(str)); in TEST()
28 store.push_back(fmt::string_view{str}); in TEST()
31 auto result = fmt::vformat("{} and {} and {}", store); in TEST()
53 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
55 store.push_back(c); in TEST()
57 store.push_back(c); in TEST()
59 store.push_back(std::cref(c)); in TEST()
61 auto result = fmt::vformat("{} and {} and {}", store); in TEST()
82 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
84 store.push_back(s); in TEST()
85 store.push_back(std::cref(s)); in TEST()
86 fmt::vformat("", store); in TEST()
90 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
91 store.push_back(fmt::arg("a1", 42)); in TEST()
92 EXPECT_EQ("42", fmt::vformat("{a1}", store)); in TEST()
96 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
98 store.push_back(fmt::arg("a1", str)); in TEST()
99 store.push_back(fmt::arg("a2", std::cref(str))); in TEST()
101 EXPECT_EQ("1234567890 and X234567890", fmt::vformat("{a1} and {a2}", store)); in TEST()
105 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
107 store.push_back(fmt::arg("band", std::cref(band))); in TEST()
109 EXPECT_EQ(fmt::vformat("{band}", store), "Rolling Scones"); in TEST()
113 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
115 store.push_back(fmt::arg("c1", c)); in TEST()
117 store.push_back(fmt::arg("c2", c)); in TEST()
119 store.push_back(fmt::arg("c_ref", std::cref(c))); in TEST()
121 auto result = fmt::vformat("{c1} and {c2} and {c_ref}", store); in TEST()
126 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
127 store.push_back(42); in TEST()
129 auto result = fmt::vformat("{}", store); in TEST()
132 store.push_back(43); in TEST()
133 result = fmt::vformat("{} and {}", store); in TEST()
136 store.clear(); in TEST()
137 store.push_back(44); in TEST()
138 result = fmt::vformat("{}", store); in TEST()
143 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
144 store.reserve(2, 1); in TEST()
145 store.push_back(1.5f); in TEST()
146 store.push_back(fmt::arg("a1", 42)); in TEST()
147 auto result = fmt::vformat("{a1} and {}", store); in TEST()
168 fmt::dynamic_format_arg_store<fmt::format_context> store; in TEST() local
169 store.push_back(std::string("foo")); in TEST()
171 store.push_back(copy_throwable()); in TEST()
174 EXPECT_EQ(fmt::vformat("{}", store), "foo"); in TEST()
179 auto store = std::unique_ptr<store_type>(new store_type()); in TEST() local
180 store->push_back(42); in TEST()
181 store->push_back(std::string("foo")); in TEST()
182 store->push_back(fmt::arg("a1", "foo")); in TEST()
183 auto moved_store = std::move(*store); in TEST()
184 store.reset(); in TEST()