diff options
author | Joel Rosdahl <joel.rosdahl@maxar.com> | 2022-12-21 15:15:41 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2022-12-23 10:56:43 +0100 |
commit | 7cf41457e07ae0c2f8a05f96ed7894c9ac707dde (patch) | |
tree | a3eeb982bc94b3db5c1ce13783f74d8f96dc0283 /unittest/test_util_TextTable.cpp | |
parent | aec8c89972d5b2e24ff56ce41d513586d744cfa2 (diff) | |
download | ccache-7cf41457e07ae0c2f8a05f96ed7894c9ac707dde.tar.gz |
fix: Don't crash in TextTable for a single heading row
Diffstat (limited to 'unittest/test_util_TextTable.cpp')
-rw-r--r-- | unittest/test_util_TextTable.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittest/test_util_TextTable.cpp b/unittest/test_util_TextTable.cpp index 36240731..1a996c04 100644 --- a/unittest/test_util_TextTable.cpp +++ b/unittest/test_util_TextTable.cpp @@ -33,6 +33,12 @@ TEST_CASE("TextTable") CHECK(table.render() == ""); } + SUBCASE("only a heading") + { + table.add_heading("heading"); + CHECK(table.render() == "heading\n"); + } + SUBCASE("1x1") { table.add_row({"a"}); |