Skip to content

Commit

Permalink
[NFC][libc++][test] Improves code reuse.
Browse files Browse the repository at this point in the history
This applies D140115 to the new tuple tests.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D140650
  • Loading branch information
mordante committed Jan 10, 2023
1 parent 9fff1dd commit bc21af6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,7 @@
#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 };

Expand Down
2 changes: 2 additions & 0 deletions libcxx/test/support/format.functions.common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bc21af6

Please sign in to comment.