From 149c246d2fb6647fcc78af2e4a36be1c6b69b66f Mon Sep 17 00:00:00 2001 From: Tsche <2440422+Tsche@users.noreply.github.com> Date: Fri, 28 Feb 2025 05:50:10 +0100 Subject: [PATCH] fix spacing --- src/formatting.cpp | 9 +++++---- test/unit/lib/formatting.cpp | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/formatting.cpp b/src/formatting.cpp index 0f1652b..ef7db8a 100644 --- a/src/formatting.cpp +++ b/src/formatting.cpp @@ -208,18 +208,19 @@ namespace cpptrace { const auto yellow = color ? YELLOW : ""; const auto blue = color ? BLUE : ""; if(frame.is_inline) { - microfmt::print(stream, "{<{}}", 2 * sizeof(frame_ptr) + 2, "(inlined)"); + microfmt::print(stream, "{<{}} ", 2 * sizeof(frame_ptr) + 2, "(inlined)"); } else if(options.addresses != address_mode::none) { auto address = options.addresses == address_mode::raw ? frame.raw_address : frame.object_address; - microfmt::print(stream, "{}0x{>{}:0h}{}", blue, 2 * sizeof(frame_ptr), address, reset); + microfmt::print(stream, "{}0x{>{}:0h}{} ", blue, 2 * sizeof(frame_ptr), address, reset); } if(!frame.symbol.empty()) { - microfmt::print(stream, " in {}{}{}", yellow, frame.symbol, reset); + microfmt::print(stream, "in {}{}{}", yellow, frame.symbol, reset); } if(!frame.filename.empty()) { microfmt::print( stream, - " at {}{}{}", + "{}at {}{}{}", + frame.symbol.empty() ? "" : " ", green, options.paths == path_mode::full ? frame.filename : detail::basename(frame.filename, true), reset diff --git a/test/unit/lib/formatting.cpp b/test/unit/lib/formatting.cpp index 67420dd..f718a7a 100644 --- a/test/unit/lib/formatting.cpp +++ b/test/unit/lib/formatting.cpp @@ -104,9 +104,9 @@ TEST(FormatterTest, NoAddresses) { res, ElementsAre( "Stack trace (most recent call first):", - "#0 in foo() at foo.cpp:20:30", - "#1 in bar() at bar.cpp:30:40", - "#2 in main at foo.cpp:40:25" + "#0 in foo() at foo.cpp:20:30", + "#1 in bar() at bar.cpp:30:40", + "#2 in main at foo.cpp:40:25" ) ); }