aboutsummaryrefslogtreecommitdiffstats
path: root/tests/next_word.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/next_word.cc
parent75c6b5fee029ec95e7e45e18525e3e78b9616f48 (diff)
downloadnihil-d27d1302d1fa1b96bf8f53f17fce947f19d21330.tar.gz
nihil-d27d1302d1fa1b96bf8f53f17fce947f19d21330.tar.bz2
add nihil.config (incomplete)
Diffstat (limited to 'tests/next_word.cc')
-rw-r--r--tests/next_word.cc65
1 files changed, 0 insertions, 65 deletions
diff --git a/tests/next_word.cc b/tests/next_word.cc
deleted file mode 100644
index 4055485..0000000
--- a/tests/next_word.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * This source code is released into the public domain.
- */
-
-#include <locale>
-#include <string>
-
-#include <catch2/catch_test_macros.hpp>
-
-import nihil;
-
-TEST_CASE("next_word: basic", "[next_word]")
-{
- using namespace std::literals;
- auto s = "foo bar baz"sv;
-
- auto words = nihil::next_word(s);
- REQUIRE(words.first == "foo");
- REQUIRE(words.second == " bar baz");
-
- auto word = nihil::next_word(&s);
- REQUIRE(word == "foo");
- REQUIRE(s == " bar baz");
-}
-
-TEST_CASE("next_word: multiple spaces", "[next_word]")
-{
- using namespace std::literals;
- auto s = "foo bar baz"sv;
-
- auto words = nihil::next_word(s);
- REQUIRE(words.first == "foo");
- REQUIRE(words.second == " bar baz");
-
- auto word = nihil::next_word(&s);
- REQUIRE(word == "foo");
- REQUIRE(s == " bar baz");
-}
-
-TEST_CASE("next_word: leading spaces", "[next_word]")
-{
- using namespace std::literals;
- auto s = " \tfoo bar baz"sv;
-
- auto words = nihil::next_word(s);
- REQUIRE(words.first == "foo");
- REQUIRE(words.second == " bar baz");
-
- auto word = nihil::next_word(&s);
- REQUIRE(word == "foo");
- REQUIRE(s == " bar baz");
-}
-
-TEST_CASE("next_word: locale", "[next_word]")
-{
- using namespace std::literals;
- auto s = L"\u2003foo\u2003bar\u2003baz"sv;
-
- auto words = nihil::next_word(s);
- REQUIRE(words.first == s);
-
- words = nihil::next_word(s, std::locale("C.UTF-8"));
- REQUIRE(words.first == L"foo");
- REQUIRE(words.second == L"\u2003bar\u2003baz");
-}