- 3a9532fb2d6ae45c3cba44c9bb0dbdfc1558b7d3 Fix the description of Span::subspan(). by Abseil Team <absl-team@google.com>
- bae1a1c21924bd31fa7315eff05ea6158d9e7947 Port the symbolizer to Windows. by Derek Mauro <dmauro@google.com> - 2253c04c1a4f39d9581772f1dc4491878aa3831f Support absl::Hex() and absl::Dec() as arguments to absl:... by Jorg Brown <jorg@google.com> - 552c3ac259e9c254fda9244755487f3423d2fe4b Internal change by Jorg Brown <jorg@google.com> GitOrigin-RevId: 3a9532fb2d6ae45c3cba44c9bb0dbdfc1558b7d3 Change-Id: I448133c9bb6d837037c12b45a9a16a7945049453
This commit is contained in:
parent
af7882601a
commit
19b3c95727
10 changed files with 223 additions and 26 deletions
|
|
@ -43,6 +43,24 @@ TEST(SubstituteTest, Substitute) {
|
|||
-1234567890, 3234567890U, -1234567890L, 3234567890UL,
|
||||
-int64_t{1234567890123456789}, uint64_t{9234567890123456789u}));
|
||||
|
||||
// Hex format
|
||||
EXPECT_EQ("0 1 f ffff0ffff 0123456789abcdef",
|
||||
absl::Substitute("$0$1$2$3$4 $5", //
|
||||
absl::Hex(0), absl::Hex(1, absl::kSpacePad2),
|
||||
absl::Hex(0xf, absl::kSpacePad2),
|
||||
absl::Hex(int16_t{-1}, absl::kSpacePad5),
|
||||
absl::Hex(int16_t{-1}, absl::kZeroPad5),
|
||||
absl::Hex(0x123456789abcdef, absl::kZeroPad16)));
|
||||
|
||||
// Dec format
|
||||
EXPECT_EQ("0 115 -1-0001 81985529216486895",
|
||||
absl::Substitute("$0$1$2$3$4 $5", //
|
||||
absl::Dec(0), absl::Dec(1, absl::kSpacePad2),
|
||||
absl::Dec(0xf, absl::kSpacePad2),
|
||||
absl::Dec(int16_t{-1}, absl::kSpacePad5),
|
||||
absl::Dec(int16_t{-1}, absl::kZeroPad5),
|
||||
absl::Dec(0x123456789abcdef, absl::kZeroPad16)));
|
||||
|
||||
// Pointer.
|
||||
const int* int_p = reinterpret_cast<const int*>(0x12345);
|
||||
std::string str = absl::Substitute("$0", int_p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue