From d27d1302d1fa1b96bf8f53f17fce947f19d21330 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Sat, 21 Jun 2025 17:18:57 +0100 Subject: add nihil.config (incomplete) --- tests/tabulate.cc | 75 ------------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 tests/tabulate.cc (limited to 'tests/tabulate.cc') 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 -#include -#include - -#include - -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"); -} -- cgit v1.2.3