From 5c17a7d678a26fd3d9f9ca08a5285b7caf487678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 5 Oct 2018 21:34:41 -0700 Subject: [PATCH] Added strSkip unit test. --- tests/string_test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 88cbbc3..0679a13 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -223,6 +223,22 @@ TEST_CASE("strFind", "") } } +TEST_CASE("strSkip", "") +{ + const bx::StringView t0(" test X"); + + const bx::StringView t1 = bx::strSkipSpace(t0); + REQUIRE(0 == bx::strCmp(t1, "test", 4) ); + + const bx::StringView t2 = bx::strSkipNonSpace(t1); + REQUIRE(0 == bx::strCmp(t2, " X", 2) ); + + const bx::StringView t3("test"); + + const bx::StringView t4 = bx::strSkipNonSpace(t3); + REQUIRE(t4.getTerm() == t4.getPtr() ); +} + template static bool testToStringS(Ty _value, const char* _expected, char _separator = '\0') {