[NFC][libc++][test] Improves code reuse.
authorMark de Wever <koraq@xs4all.nl>
Sat, 24 Dec 2022 12:33:21 +0000 (13:33 +0100)
committerMark de Wever <koraq@xs4all.nl>
Tue, 10 Jan 2023 17:49:58 +0000 (18:49 +0100)
This applies D140115 to the new tuple tests.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D140650

libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
libcxx/test/support/format.functions.common.h

index 159a617..64d3ce4 100644 (file)
 #include <concepts>
 #include <format>
 
-#include "make_string.h"
-
-#define STR(S) MAKE_STRING(CharT, S)
-#define SV(S) MAKE_STRING_VIEW(CharT, S)
-
-template <class T>
-struct context {};
-
-template <>
-struct context<char> {
-  using type = std::format_context;
-};
-
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-template <>
-struct context<wchar_t> {
-  using type = std::wformat_context;
-};
-#endif
-
-template <class T>
-using context_t = typename context<T>::type;
+#include "format.functions.common.h"
 
 enum class color { black, red, gold };
 
index fa107ba..14faf3a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Contains the common part of the formatter tests for different papers.
 
+#include <algorithm>
+#include <charconv>
 #include <format>
 
 #include "make_string.h"