1
0
forked from Alepha/Alepha
Files

44 lines
1.3 KiB
C++

static_assert( __cplusplus > 2020'99 );
#include "../print_number.h"
#include <Alepha/Testing/TableTest.h>
#include <Alepha/Testing/test.h>
#include <Alepha/Utility/evaluation_helpers.h>
static auto init= Alepha::Utility::enroll <=[]
{
using namespace Alepha::Testing::exports;
"Do simple numerical tests come out as we want?"_test
<=TableTest< Alepha::Utility::formatPrint >::Cases
{
{ "zero", { 0 }, "zero" },
{ "one", { 1 }, "one" },
{ "seven hundred", { 700 }, "seven hundred" },
{ "one thousand twenty four", { 1024 }, "one thousand twenty four" },
{ "ten thousand two hundred forty", { 10240 }, "ten thousand two hundred forty" },
{ "1283721", { 1'283'721 }, "one million two hundred eighty three thousand seven hundred twenty one" },
{ "1000283000721", { 1'000'283'000'721 },
"one trillion two hundred eighty three million seven hundred twenty one" },
{ "1000283000000", { 1'000'283'000'000 },
"one trillion two hundred eighty three million" },
// I just detected this weird case:
{ "1000100006000500", { 1000100006000500 },
"one quadrillion one hundred billion six million five hundred" },
};
-"repl"_test <=[]
{
while( std::cin )
{
std::uint64_t value;
std::cout << "input: " << std::flush;
std::cin >> value;
std::cout << Alepha::Utility::formatPrint( value ) << std::endl;
}
};
};