aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tabulate.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-21 17:18:57 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-21 17:18:57 +0100
commitd27d1302d1fa1b96bf8f53f17fce947f19d21330 (patch)
treef56ef29d7816c3b574b3359c746355a44e3b0819 /tests/tabulate.cc
parent75c6b5fee029ec95e7e45e18525e3e78b9616f48 (diff)
downloadnihil-d27d1302d1fa1b96bf8f53f17fce947f19d21330.tar.gz
nihil-d27d1302d1fa1b96bf8f53f17fce947f19d21330.tar.bz2
add nihil.config (incomplete)
Diffstat (limited to 'tests/tabulate.cc')
-rw-r--r--tests/tabulate.cc75
1 files changed, 0 insertions, 75 deletions
diff --git a/tests/tabulate.cc b/tests/tabulate.cc
deleted file mode 100644
index 84f8b33..0000000
--- a/tests/tabulate.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This source code is released into the public domain.
- */
-
-#include <iterator>
-#include <string>
-#include <vector>
-
-#include <catch2/catch_test_macros.hpp>
-
-import nihil;
-
-using namespace std::literals;
-using namespace nihil;
-
-TEST_CASE("tabulate: basic", "[tabulate]")
-{
- auto input = std::vector{
- std::vector{"a", "foo", "b"},
- std::vector{"bar", "c", "baz"},
- };
-
- auto result = std::string();
- tabulate("{:1} {:2} {:3}", input, std::back_inserter(result));
- REQUIRE(result ==
-"1 2 3\n"
-"a foo b\n"
-"bar c baz\n");
-}
-
-TEST_CASE("tabulate: basic wide", "[tabulate]")
-{
- auto input = std::vector{
- std::vector{L"a", L"foo", L"b"},
- std::vector{L"bar", L"c", L"baz"},
- };
-
- auto result = std::wstring();
- wtabulate(L"{:1} {:2} {:3}", input, std::back_inserter(result));
-
- REQUIRE(result ==
-L"1 2 3\n"
-"a foo b\n"
-"bar c baz\n");
-}
-
-TEST_CASE("tabulate: jagged", "[tabulate]")
-{
- auto input = std::vector{
- std::vector{"a", "foo", "b"},
- std::vector{"bar", "baz"},
- };
-
- auto result = std::string();
- tabulate("{:1} {:2} {:3}", input, std::back_inserter(result));
- REQUIRE(result ==
-"1 2 3\n"
-"a foo b\n"
-"bar baz\n");
-}
-
-TEST_CASE("tabulate: align", "[tabulate]")
-{
- auto input = std::vector{
- std::vector{"a", "longvalue", "s"},
- std::vector{"a", "s", "longvalue"},
- };
-
- auto result = std::string();
- tabulate("{:1} {<:2} {>:3}", input, std::back_inserter(result));
- REQUIRE(result ==
-"1 2 3\n"
-"a longvalue s\n"
-"a s longvalue\n");
-}