Commit Graph

1345 Commits

Author SHA1 Message Date
Victor Zverovich
48ea8193df Explain why assert-test is a separate test 2020-10-11 10:13:42 -07:00
Victor Zverovich
1d112bdd1e Remove old test 2020-10-11 10:13:42 -07:00
Victor Zverovich
7e56b6b6cb Fix coding style and remove duplicate fuzzer 2020-10-11 08:07:52 -07:00
Victor Zverovich
a5e7e7db95 Fix handling of thousand separator (#1927) 2020-10-10 07:23:36 -07:00
Victor Zverovich
7eddbfed53 Cleanup exponent handling in write_float 2020-10-07 15:58:43 -07:00
Victor Zverovich
a18b3fbbdc Fix fixed precision handling when rounding (#1917) 2020-10-07 07:42:23 -07:00
Victor Zverovich
af8a180aed Make GetCachedPower test more precise 2020-10-04 08:00:47 -07:00
Victor Zverovich
90ef46df0b Fix dragonbox integration 2020-09-28 18:10:46 -07:00
Victor Zverovich
79694d424c Fix WriteConsole signature 2020-09-27 14:26:28 -07:00
Victor Zverovich
51f2e2ca27 Move nan test to where it belongs 2020-09-27 12:50:18 -07:00
Victor Zverovich
68555fdbd2 Make format-test not depend on color.h 2020-09-27 09:17:57 -07:00
Victor Zverovich
a905d8f704 Merge grisu-test into format-test 2020-09-26 08:23:16 -07:00
Victor Zverovich
c156093ffd Fix carry in fallback_format 2020-09-25 10:12:44 -07:00
Victor Zverovich
6c025520aa Test that max_k is correctly defined 2020-09-23 15:44:37 -07:00
Victor Zverovich
2d4fde3a2e Don't emit trailing zero for consistency with std::format 2020-09-23 09:19:12 -07:00
Victor Zverovich
aa729bf25b Remove dead code 2020-09-22 16:58:02 -07:00
jk-jeon
6bcde9aab2
https://github.com/fmtlib/fmt/pull/1882#issuecomment-696823912 (#1894) 2020-09-22 10:33:52 -07:00
Victor Zverovich
16410056bf Optimize copy_str for counting_iterator 2020-09-22 07:56:09 -07:00
Victor Zverovich
2f7e08856b Disable range formatter if value type is not formattable (#1885) 2020-09-20 08:37:49 -07:00
Victor Zverovich
c46a8de4e1 Simplify test 2020-09-20 07:24:24 -07:00
rimathia
2696dc9273
add forgotten template argument to make_format_args which made some u… (#1877)
* add forgotten template argument to make_format_args which made some uses of FMT_COMPILE not work anymore after 54daa0864a, add more elaborate test cases to compile-test as regression tests

* fix old-style cast which gcc on travis thankfully doesn't accept anymore

* hopefully last forgotten (void*)
2020-09-20 06:51:11 -07:00
Victor Zverovich
7e6827521a Remove trailing zeros when using fallback formatter (#1873) 2020-09-17 08:16:21 -07:00
Victor Zverovich
1d696dc280 Handle exotic character types in compilation 2020-09-17 07:12:34 -07:00
Alexey Ochapov
f674434a67
Add format_to_n overload that accepts FMT_COMPILE (from #1767) (#1869)
* Add format_to_n overload that accepts FMT_COMPILE

* add FormatToNWithCompileMacro test into CompileTest

Co-authored-by: Dmitriy Kurkin <Dmitriy.Kurkin@itiviti.com>
2020-09-15 07:28:06 -07:00
Victor Zverovich
5b5a597198 Fix handling of wide alignment 2020-09-15 06:53:06 -07:00
Victor Zverovich
dce8e49b4f Handle float in fallback formatter 2020-09-13 09:28:40 -07:00
Victor Zverovich
4f2ee8921d Use built-in FP formatter for any precision 2020-09-11 07:20:16 -07:00
Victor Zverovich
9f312fe87e Implement fallback FP formatting with given precision (#1526) 2020-09-07 09:34:30 -07:00
Victor Zverovich
fb289cf56b Fix coding conventions 2020-09-06 09:26:32 -07:00
Denis Blank
bff4d18efb Add color format_to overloads
* Fix variable size basic_memory_buffer colorization
* Fix an unused arguments warning on GCC that blocks the CI otherwise
* Ref #1842
* Ref #1593
2020-09-06 08:24:15 -07:00
Victor Zverovich
6cccdc24bc Fix move constructor (#1844) 2020-09-01 08:48:56 -07:00
Adam Burgess
f39e6fb617
Add formatters for chrono::time_point<system_clock> (#1837)
Add formatters for chrono::time_point and helper overloads for localtime/gmtime(time_point)
Fixes #1819
2020-08-28 07:41:38 -07:00
Victor Zverovich
5dff01d31b Add complex tests 2020-08-26 11:48:50 -07:00
Alexey Ochapov
1651b2d433
Fix detail::write with fallback formatter (#1829)
* add support for fallback_formatter in detail::write

* add ToString test into OStreamTest

to check fmt::to_string() with class that has output stream operator

* add WithOstreamOperator test into CompileTest

to check fmt::format() with FMT_COMPILE() and class that has output stream operator

* use conditional_t inside detail::write instead of 2 overloads

* Revert "add WithOstreamOperator test into CompileTest"

* remove Context from template parameters in detail::write
2020-08-20 06:41:09 -07:00
Barry Revzin
6be6544668
Fixing buffer_appender's ++ slicing (#1822)
* Fixing buffer_appender's ++ slicing.

* This test requires C++14.

* Removing string_view dependency.

* Simplifying test case.

* Adding message to static_assert
2020-08-18 12:37:56 -07:00
medithe
f9f02df719
CMakeLists.txt: Clang-warnings: removed -Wno-sign-conversion (#1817)
* CMakeLists.txt: Clang-warnings: removed -Wno-sign-conversion

* test/ranges-test.cc: changed type of integer literals to unsigned

* test/format-test.cc: fixed implicit conversion changes signedness warning in clang

Co-authored-by: Martin Wührer <martin.wuehrer@artech.at>
2020-08-14 13:58:20 -07:00
Victor Zverovich
54daa0864a Add dynamic width support to FMT_COMPILE (#1809) 2020-08-10 09:40:11 -07:00
Victor Zverovich
4fd95e4b4d Don't remove trailing zeros with # 2020-08-08 08:14:39 -07:00
Victor Zverovich
065889a593 Use correct capacity in iterator_buffer (#1807) 2020-08-08 07:01:21 -07:00
Barry Revzin
d0dd678693 Adding convenience append(range) 2020-08-08 06:33:46 -07:00
Victor Zverovich
279d698e1b Fix handling of default alignmment with locale (#1801) 2020-08-03 10:51:42 -07:00
Victor Zverovich
76cfb50b2d Test complex formatter 2020-08-03 10:05:18 -07:00
Victor Zverovich
7c4c5c79d2 Make buffer size configurable 2020-08-01 10:53:58 -07:00
Victor Zverovich
21c8b5c142 Report error on missing named argument (#1796) 2020-07-30 07:16:15 -07:00
Victor Zverovich
d82fdcc9e2 Fix handling of iterators in locale-specific formatting (#1782) 2020-07-30 07:03:11 -07:00
Tony E Lewis
febffa4e64
Make join() handle non-const-only begin/end ranges (#1786)
See fmtlib/fmt#1784.

Add tests that demonstrate the problem and check obvious variations.
2020-07-21 12:13:00 -07:00
Raul Tambre
26b47b6fb5 Bump tested CMake version to 3.18
Use the version range feature introduced in 3.12. On CMake <3.12 the extra dots are simply interpreted as extra version number separators.
The fallback for ancient CMake versions is kept.
2020-07-19 08:50:34 -07:00
Victor Zverovich
b17d5c4f5d Fix a regression in handling digit separators (#1782) 2020-07-18 08:31:47 -07:00
Victor Zverovich
c26349f4d2 Improve error reporting 2020-07-14 12:06:12 -07:00
Dmitriy Vetutnev
a03bd3ddb0
Autodetect MSVC static runtime (#1770)
* Autodetect MSVC static runtime

* Update condition (MSVC)
2020-07-13 06:11:23 -07:00
Victor Zverovich
16cac46a09 Improve handling of streamable and convertible to bool types (#1766) 2020-07-12 08:34:45 -07:00
Victor Zverovich
415cd51913 direct_buffered_file -> ostream 2020-07-11 17:29:17 -07:00
Victor Zverovich
e1bfb59619 Fix handling of code units in compile 2020-07-11 09:03:21 -07:00
Victor Zverovich
e4f57bfd7f Add an overload of write for buffer_appender 2020-07-11 08:20:30 -07:00
Victor Zverovich
d870468159 Make append work with fixed-size buffer 2020-07-11 07:27:20 -07:00
Victor Zverovich
e8ec09ae83 Cleanup core-test 2020-07-10 21:25:27 -07:00
Victor Zverovich
a2c4fed981 Double buffering no more 2020-07-10 20:35:14 -07:00
Victor Zverovich
60c43e8703 Apply clang-format 2020-07-09 09:06:24 -07:00
Victor Zverovich
b998e0f30b Reduce symbol sizes and simplify iterator use 2020-07-09 08:51:43 -07:00
Victor Zverovich
01309a34ab Deprecate arg_formatter 2020-07-04 07:29:11 -07:00
Victor Zverovich
56fed78149 FMT_NUMERIC_ALIGN -> FMT_DEPRECATED_NUMERIC_ALIGN 2020-07-03 08:53:01 -07:00
Victor Zverovich
56e63078ff Make the n specifier an opt-in 2020-07-03 08:02:48 -07:00
Victor Zverovich
f69b6eaabd Add a simple buffered stream with no sync 2020-06-28 09:55:29 -07:00
Victor Zverovich
98a7a8b405 Update changelog and disable internal 2020-06-26 19:07:33 -07:00
Victor Zverovich
4e94c649f9 Deprecate compile 2020-06-23 14:03:37 -07:00
Victor Zverovich
1a83443e6c Add user-defined type support to compilation 2020-06-23 12:45:57 -07:00
Victor Zverovich
2cac8a9d2e Reintroduce UDT support to fmt::to_string and test ADL 2020-06-21 09:21:07 -07:00
Victor Zverovich
9a4cc88426 Add FMT_COMPILE support to format_to 2020-06-20 15:15:41 -07:00
Victor Zverovich
397ad1bec3 Optimize common case 2020-06-15 18:30:31 -07:00
Victor Zverovich
ab2f8484e0 Finish text::format 2020-06-14 11:04:41 -07:00
Victor Zverovich
d702a68df2 Fix formatting of bool with FMT_COMPILE and add more tests 2020-06-14 07:16:50 -07:00
Victor Zverovich
8c88abde64 Fix sign handling in 'L' 2020-06-13 06:57:19 -07:00
Victor Zverovich
16637341b9 Enable compilation for all types 2020-06-12 13:27:21 -07:00
Victor Zverovich
936a1833c2 Add default_arg_formatter 2020-06-08 08:14:34 -07:00
Victor Zverovich
50bad7d62d Optimize format string parsing 2020-06-06 10:15:19 -07:00
Victor Zverovich
f11e968708 Optimize format string parsing 2020-06-06 08:15:33 -07:00
rimathia
95c6ac0cc8 fix typo which caused the loss of the counting information when using a printf context with a truncating_iterator 2020-06-05 07:37:54 -07:00
Victor Zverovich
3245145a41 Remove undocumented buffer_range and output_range 2020-05-30 13:07:52 -07:00
Victor Zverovich
f095c67b6a Remove uses of buffer_range 2020-05-29 18:14:03 -07:00
Victor Zverovich
19c5b5d159 Simplify arg_formatter 2020-05-29 16:53:12 -07:00
Victor Zverovich
519571edec Simplify arg_formatter_base 2020-05-29 14:44:18 -07:00
rimathia
8c8f74a870 fix zero flag for char types and make zero flag ignored if a precision is specified 2020-05-23 12:46:26 -07:00
Victor Zverovich
943532fece Make ostream formatter work with compile-time format strings (#1692) 2020-05-20 14:59:57 -07:00
Barry Revzin
c66aae1652
Adding sentinel support to fmt::join(). (#1689) 2020-05-18 06:31:01 -07:00
Victor Zverovich
6d66de3805 Add c specifier support to integral types (#1652) 2020-05-17 08:44:59 -07:00
rimathia
6b219a58db
fix interaction of space flag and '+' flag, as well as '-' flag and '0' flag (#1687) 2020-05-17 04:27:18 -07:00
rimathia
96c18b26c2
make plus flag for printf not be ignored for char argument (#1683)
* make plus flag for printf not be ignored for char argument

* clarify overwriting of alignment specifiers for printf with char argument
2020-05-15 06:45:51 -07:00
Vladimir Solontsov
922ea924bf
Make dynamic_format_arg_store reusable and add reserve() (#1677)
Implemented #1674: make dynamic_format_arg_store reusable and add
reserve() for better memory menagement.
2020-05-12 11:00:42 -07:00
Victor Zverovich
8069265373 internal -> detail (#1538) 2020-05-10 07:34:30 -07:00
Victor Zverovich
02a6fe59fb Named arguments go brrr 2020-05-09 13:22:38 -07:00
Vladimir Solontsov
68201831a5
Support named args in dynamic_format_arg_store (#1655). (#1663)
Dynamic arguments storage. Implementation of enhancement from issue
#1170.
2020-05-09 06:25:03 -07:00
Victor Zverovich
7f723fbcb8 Consistently namespace qualify size_t 2020-05-07 15:59:46 -07:00
Victor Zverovich
c06851456d Purge basic_writer 2020-05-07 15:04:48 -07:00
Victor Zverovich
2f05054dd3 Purge basic_writer 2020-05-07 11:35:41 -07:00
Victor Zverovich
8f511fc12f Make copyfmt not throw (#1666) 2020-05-06 17:38:46 -07:00
Victor Zverovich
d6cea50d01 Remove deprecated APIs 2020-05-05 20:03:48 -07:00
Victor Zverovich
bab3f58003 Refactor pointer formatting 2020-05-03 20:33:25 -07:00
Victor Zverovich
a71bc9c825 Use '0' fill with numeric align for consistency with std::format 2020-05-03 09:52:31 -07:00
asraa
e2ff910675
Replace FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION with fmt-specific macro (#1650)
Signed-off-by: Asra Ali <asraa@google.com>
2020-04-29 09:12:43 -07:00
Victor Zverovich
1e1ac6e964 Check dynamic width/precision id at compile time (#1614) 2020-04-25 08:36:24 -07:00