Add fmt::to_string (#326)

This commit is contained in:
Victor Zverovich
2016-05-18 19:54:52 -07:00
parent d00b43c592
commit b6c0cf9683
5 changed files with 56 additions and 3 deletions

View File

@@ -77,6 +77,7 @@ add_fmt_test(format-test)
add_fmt_test(format-impl-test)
add_fmt_test(ostream-test)
add_fmt_test(printf-test)
add_fmt_test(string-test)
add_fmt_test(util-test mock-allocator.h)
add_fmt_test(macro-test)
@@ -87,7 +88,8 @@ if (FMT_PEDANTIC AND MSVC)
endif ()
if (HAVE_OPEN)
add_executable(posix-mock-test posix-mock-test.cc ../fmt/format.cc ${TEST_MAIN_SRC})
add_executable(posix-mock-test
posix-mock-test.cc ../fmt/format.cc ${TEST_MAIN_SRC})
target_include_directories(posix-mock-test PRIVATE ${PROJECT_SOURCE_DIR})
target_compile_definitions(posix-mock-test PRIVATE FMT_USE_FILE_DESCRIPTORS=1)
target_link_libraries(posix-mock-test gmock)

15
test/string-test.cc Normal file
View File

@@ -0,0 +1,15 @@
/*
Tests of string utilities
Copyright (c) 2012 - 2016, Victor Zverovich
All rights reserved.
For the license information refer to format.h.
*/
#include "fmt/string.h"
#include "gtest/gtest.h"
TEST(StringTest, ToString) {
EXPECT_EQ("42", fmt::to_string(42));
}