xref: /aosp_15_r20/external/fmtlib/test/ranges-odr-test.cc (revision 5c90c05cd622c0a81b57953a4d343e0e489f2e08)
1 // Formatting library for C++ - the core API
2 //
3 // Copyright (c) 2012 - present, Victor Zverovich
4 // All rights reserved.
5 //
6 // For the license information refer to format.h.
7 
8 #include <vector>
9 
10 #include "fmt/format.h"
11 #include "fmt/ranges.h"
12 #include "gtest/gtest.h"
13 
14 // call fmt::format from another translation unit to test ODR
TEST(ranges_odr_test,format_vector)15 TEST(ranges_odr_test, format_vector) {
16   auto v = std::vector<int>{1, 2, 3, 5, 7, 11};
17   EXPECT_EQ(fmt::format("{}", v), "[1, 2, 3, 5, 7, 11]");
18 }
19