File: no-builtin-types-test.cc

package info (click to toggle)
fmtlib 11.1.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,772 kB
  • sloc: cpp: 22,591; ansic: 758; python: 504; sh: 53; makefile: 16; javascript: 4
file content (24 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Formatting library for C++ - formatting library tests
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.

#include "gtest/gtest.h"

#if !defined(__GNUC__) || __GNUC__ >= 5
#define FMT_BUILTIN_TYPES 0
#include "fmt/format.h"

TEST(no_builtin_types_test, format) {
  EXPECT_EQ(fmt::format("{}", 42), "42");
}

TEST(no_builtin_types_test, double_is_custom_type) {
  double d = 42;
  auto args = fmt::make_format_args(d);
  EXPECT_EQ(fmt::format_args(args).get(0).type(),
            fmt::detail::type::custom_type);
}
#endif