Commit Graph

1549 Commits

Author SHA1 Message Date
Victor Zverovich
3940de5952 thousands -> group_digits 2021-09-05 06:47:18 -07:00
Victor Zverovich
c4d0f96a6d Implement format specs in fmt::thousands 2021-09-04 06:56:51 -07:00
Victor Zverovich
3b9c442689 Implement thousands separators without locales 2021-09-04 06:32:46 -07:00
Victor Zverovich
60cd5ea3f2 Add support for more formattable types in ranges 2021-09-03 14:55:41 -07:00
Victor Zverovich
5681563898 Cleanup ostream interface 2021-09-03 10:35:19 -07:00
Victor Zverovich
20931baf1d Disable fallback_formatter for arrays 2021-09-03 08:59:36 -07:00
Pierre-Antoine Lacaze
d58d19ba32
Fix an odr violation in ranges.h (#2483)
* Add a testcase demonstrating ODR violation in ranges.h

* Fix ODR violation in ranges.h

* Fix comments

Co-authored-by: Pierre-Antoine Lacaze <pa.lacaze@gmail.com>
2021-09-02 08:47:44 -07:00
Victor Zverovich
ee0659f8b6 Fix formatting of abstract classes via ostream 2021-09-02 08:19:12 -07:00
Paul Dreik
4db5723525
add fuzzers for chrono timepoint and localtime,gmtime (#2469)
* add fuzzers for chrono timepoint and localtime,gmtime

* reorder cases to improve throughput

mutating the first byte of the input now always results in picking
on of the two paths. Before, two of the four possible outcomes resulted
in doit() not being invoked.

* drop the localtime fuzzer

* inline aliases

* only fuzz std::chrono::system_clock
2021-08-29 06:58:23 -07:00
Victor Zverovich
729a44e67d Depreate strtod and remove problematic tests 2021-08-28 09:20:36 -07:00
Victor Zverovich
043e3b3429 Remove static_assert from arg_mapper 2021-08-26 20:45:01 -07:00
Victor Zverovich
8b0cb944da Fix error reporting when mixing character types 2021-08-26 18:16:05 -07:00
Victor Zverovich
6d597e39c3 Fix overload ambiguity in arg_mapper 2021-08-26 16:54:27 -07:00
Victor Zverovich
f889e52a15 Improve error reporting 2021-08-26 15:47:44 -07:00
sunmy2019
a44c8f651b
reimplement formatter<tuple_join_view> (#2457)
* reimplement `formatter<tuple_join_view>`

1. completely reimplement `formatter<tuple_join_view<Char, T...>, Char>`
2. Add some tests

* use FMT_THROW
2021-08-23 09:51:19 -07:00
Paul Dreik
6b5e6119ee set clang in one place 2021-08-22 17:52:45 -07:00
Paul Dreik
7af1dc1d27 fix UB in fuzzer common (memcpy on nullptr) 2021-08-22 17:52:45 -07:00
Paul Dreik
e77686f7a8 clang format
using clang format 11
2021-08-22 17:52:45 -07:00
Victor Zverovich
2207ea0b36 More escaping 2021-08-22 16:54:26 -07:00
Victor Zverovich
a212ff757f Escape invalid code points 2021-08-22 15:51:33 -07:00
Victor Zverovich
07d033ecb4 Fix is_printable 2021-08-22 10:37:18 -07:00
Victor Zverovich
371d8e2ee0 Escape Unicode 2021-08-22 07:55:59 -07:00
Victor Zverovich
6397095ca4 More escaping 2021-08-21 16:36:25 -07:00
Victor Zverovich
11b07a56b2 We should escape 2021-08-19 14:50:59 -07:00
Victor Zverovich
b559cfd4c0 Implement basic escaping 2021-08-19 14:12:26 -07:00
Victor Zverovich
6ea6cf9464 Add decimal separator support to float 2021-08-14 09:16:26 -07:00
Vladislav Shchapov
07211701f4
Disable the -Wstringop-overflow warning from GCC 7 (#2442) 2021-08-02 14:20:18 -07:00
Victor Zverovich
bba0a9d962 Make flush public 2021-07-30 07:02:49 -07:00
Victor Zverovich
f1794a8853 Switch to threadsafe death test style 2021-07-29 06:56:38 -07:00
Victor Zverovich
5c222f0561 Add support for nonconst formattable types 2021-07-24 09:53:53 -07:00
Spiros Tsalikis
63fe2d5bd2 Add copy constructor for dynamic_format_arg_store, and test 2021-07-23 09:35:09 -07:00
Cameron DaCamara
00235d8a99
fix module test odr violations (#2414) 2021-07-17 09:16:49 -07:00
Victor Zverovich
2038bf6183 Update format_to usage 2021-07-13 07:56:24 -07:00
mwinterb
3d53d1539d
Warning removals in test code (#2399)
* Warning removals in test code.

Mostly 0 to nullptr and adding override to virtual function implementations.

* Fix module-test.
2021-07-09 08:05:02 -07:00
Daniela Engert
f2b03facd9
Include test sources to pick up functions and classes from the module rather than from the non-modular library which is baked into the test-main library. (#2356)
This averts linker problems:
 - strong ownership model: missing linker symbols
 - weak ownership model: duplicate linker symbols

Simplify `gtest-extra.cc` while at it.
2021-07-03 07:21:54 -07:00
Benoît Lormeau
02ad5e11da
Add faint, blink, reverse and conceal to the emphases (#2394) 2021-07-02 20:03:55 -07:00
Victor Zverovich
1d7384530e Add missing presentation type checks for std::string (#2402) 2021-07-02 07:51:04 -07:00
Daniela Engert
5221242f6e Instruct msvc to report the _true_ value in __cplusplus and force _full_ C++ conformance
* do this  in _some_ tests to improve test coverage and catch possible problems due to that
 * fix invalid export of `static constexpr` constant
 * fix msvc warnings about unreachable code in high warning levels
2021-06-24 09:10:08 -07:00
Victor Zverovich
e421d52713 Simplify error handling in parse_nonnegative_int 2021-06-14 16:05:37 -07:00
sunmy2019
f28cf3302d
adding a default format for std::chrono::time_point<std::chrono::syst… (#2345) 2021-06-11 10:52:39 -07:00
Daniela Engert
55010a9d3a Support non-char overloads (module) 2021-06-11 09:38:53 -07:00
Daniela Engert
0193e7c428 Support compile-time strings and compile-time format string compilation in module
Make just the necessary parts available for lookup from client context.
2021-06-11 09:38:53 -07:00
Владислав Щапов
f6b5cc9f84 Fix chrono_test.weekday on legacy glibc 2021-06-10 16:17:10 -07:00
Daniela Engert
59a298f124 Enable enforce-checks-test for MSVC, too 2021-06-10 12:54:54 -07:00
Victor Zverovich
2039dce75f Detect consteval 2021-06-07 06:57:43 -07:00
Victor Zverovich
d551b88a6d Move is_char specializations to xchar.h 2021-06-06 15:32:30 -07:00
Victor Zverovich
16c3514d01 wchar-test -> xchar-test 2021-06-06 07:59:18 -07:00
Victor Zverovich
206000a017 Workaround pathological conversion (#2343) 2021-06-06 07:18:44 -07:00
Victor Zverovich
76ee490468 Move wchar/custom char overloads to xchar.h 2021-06-05 22:57:45 -07:00
Victor Zverovich
e77b22d6da Deprecate memory buffer overload of format_to 2021-06-05 14:58:36 -07:00
Владислав Щапов
f286139d22 Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Remove unused FMT_EXTERN_TEMPLATE_API
2021-06-02 14:33:17 -07:00
Victor Zverovich
d338d66324 Cleanup the printf implementation 2021-06-01 19:30:46 -07:00
Daniela Engert
70e67ae018 Re-enable module testing
Prepare for compilation with gcc (modules branch).
2021-06-01 14:49:56 -07:00
Victor Zverovich
ad97258915 Merge branch 'master' of github.com:fmtlib/fmt 2021-06-01 13:38:26 -07:00
Victor Zverovich
ed2a6377e7 Workaround msvc constexpr issues 2021-06-01 13:32:44 -07:00
Alexey Ochapov
9976869549 fix custom types formatting at compile-time, add test 2021-06-01 11:16:05 -07:00
Victor Zverovich
bf9904ee4d Workaround msvc bugs 2021-05-31 08:25:05 -07:00
Victor Zverovich
577bce9029 Apply clang-format 2021-05-31 08:09:10 -07:00
Daniela Engert
ba4c7f193b
Swap parameter order to match #2327 (#2329) 2021-05-31 07:44:33 -07:00
Victor Zverovich
11a14db286 Update format_to taking a buffer and remove undocumented vformat_to overload 2021-05-30 07:57:51 -07:00
Victor Zverovich
486a80e8ef Move wchar_t overloads to xchar.h 2021-05-30 06:41:39 -07:00
Victor Zverovich
ff37e41625 wchar.h -> xchar.h because it handles other code unit types too 2021-05-29 09:37:17 -07:00
Victor Zverovich
a9a9018191 Move wmemory_buffer to wchar.h 2021-05-29 08:26:04 -07:00
Daniela Engert
272b0f36b3
More module tests (#2309)
core.h, format.h, args.h, chrono.h, color.h, printf.h, os.h
2021-05-28 15:49:39 -07:00
Matthias Liedtke
98b9ff47a1
Align hex floats right as default (#2317) 2021-05-28 09:21:01 -07:00
Liedtke
a70a4ae053
Ignore zero-padding for non-finite floating points (#2310)
* Ignore zero-padding for non-finite floating points

* keep width for non-finite formatting with 0-padding

* clang-format

* preserve alignment

* align code-style
2021-05-27 14:13:05 -07:00
Alexey Ochapov
ee52a6dc40
add fmt::print() overload to support compiled format (#2304) 2021-05-25 14:54:56 -07:00
Victor Zverovich
35a2c2a743 Refactor chrono formatting 2021-05-25 06:57:47 -07:00
Victor Zverovich
883d9595c5 Support alternative locale names in tests 2021-05-24 14:09:19 -07:00
Victor Zverovich
1cd9899cf3 Add initial support for weekday formatting 2021-05-24 10:21:34 -07:00
Victor Zverovich
069131dc25 Add unicode-test 2021-05-24 06:20:51 -07:00
Victor Zverovich
703005c8ba Deprecate locale.h 2021-05-22 10:21:17 -07:00
Victor Zverovich
34b8acaef7 More wchar_t-specific API to wchar.h 2021-05-21 18:24:39 -07:00
Daniela Engert
5a0d99fa0b Add a test for the module 2021-05-20 10:26:31 -07:00
Victor Zverovich
63271a51c4 Fix ADL issues 2021-05-20 06:31:43 -07:00
Victor Zverovich
61b4c923d7 Reduce code bloat 2021-05-20 05:51:45 -07:00
Victor Zverovich
95c358f721 Improve separation between code unit types 2021-05-19 09:06:57 -07:00
Victor Zverovich
e9c1c415b8 Improve compile-time checks 2021-05-19 07:57:57 -07:00
Victor Zverovich
0dd91e20d5 Add wchar.h for wide char overloads 2021-05-17 21:59:10 -07:00
Victor Zverovich
d35f1ad5c1 Cleanup core 2021-05-16 10:02:33 -07:00
Alexey Ochapov
54f22a3eef add support for statically named arguments with FMT_STRING 2021-05-14 16:31:10 -07:00
Владислав Щапов
0036a1d195 Fix issue #2274. 2021-05-10 15:57:23 -07:00
Владислав Щапов
2a9b314627 Replace fmt::error_code to std::error_code 2021-05-09 12:26:19 -07:00
Владислав Щапов
4211d86539 Add a formatter specialization for std::error_code. 2021-05-09 06:29:39 -07:00
Victor Zverovich
39f28424ca Cleanup tests 2021-05-07 21:27:58 -07:00
Victor Zverovich
2665afb515 Cleanup add-subdirectory-test 2021-05-07 16:42:02 -07:00
Victor Zverovich
d0abe7c246 Make chrono formatting locale-independent by default 2021-05-07 16:14:10 -07:00
Victor Zverovich
16f2ef91ab Replace fmt::system_error with std::system_error 2021-05-07 08:33:39 -07:00
Victor Zverovich
4b885c8633 Replace windows_error with system_error 2021-05-07 06:19:03 -07:00
Victor Zverovich
9c3af11a92 Cleanup tests 2021-05-05 18:31:41 -07:00
Victor Zverovich
f0095ccd34 Add support for ranges of types without formatters to join (#2262) 2021-05-05 07:43:46 -07:00
Victor Zverovich
400b953fbb Use [] instead of {} in ranges for consistency with Python format 2021-05-04 21:04:21 -07:00
Victor Zverovich
38bcc04a11 Drop range limit and cleanup tests 2021-05-04 20:53:56 -07:00
Victor Zverovich
c738c3431f Cleanup tests 2021-05-04 17:23:13 -07:00
Victor Zverovich
ed7c4320f6 Cleanup tests 2021-05-02 09:28:38 -07:00
Victor Zverovich
9155e2de4c Cleanup tests 2021-05-01 17:11:45 -07:00
Victor Zverovich
38127d9ec0 Cleanup tests 2021-04-30 15:50:03 -07:00
Victor Zverovich
c9c0e5077d Cleanup tests 2021-04-30 06:42:38 -07:00
Victor Zverovich
ccf4ccde23 Cleanup tests and format string compilation 2021-04-29 19:50:04 -07:00
Victor Zverovich
e96a92f869 Cleanup tests and format string compilation 2021-04-29 16:21:08 -07:00