Add trim for StringRef

This commit is contained in:
Martin Hořeňovský
2019-09-07 11:31:00 +02:00
parent b77ab74b72
commit f2c2711bdc
8 changed files with 106 additions and 5 deletions

View File

@@ -1311,6 +1311,18 @@ StringManip.tests.cpp:<line number>: passed: trim(std::string(trailing_whitespac
StringManip.tests.cpp:<line number>: passed: trim(std::string(whitespace_at_both_ends)) == no_whitespace for: "There is no extra whitespace here"
==
"There is no extra whitespace here"
StringManip.tests.cpp:<line number>: passed: trim(StringRef(no_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: passed: trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: passed: trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: passed: trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14'
Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.23 == Approx( 1.23 )
Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.23 == Approx( 1.22 )

View File

@@ -1381,5 +1381,5 @@ due to unexpected exception with message:
===============================================================================
test cases: 300 | 226 passed | 70 failed | 4 failed as expected
assertions: 1558 | 1406 passed | 131 failed | 21 failed as expected
assertions: 1562 | 1410 passed | 131 failed | 21 failed as expected

View File

@@ -9813,6 +9813,34 @@ with expansion:
==
"There is no extra whitespace here"
StringManip.tests.cpp:<line number>: PASSED:
REQUIRE( trim(StringRef(no_whitespace)) == StringRef(no_whitespace) )
with expansion:
There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: PASSED:
REQUIRE( trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) )
with expansion:
There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: PASSED:
REQUIRE( trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) )
with expansion:
There is no extra whitespace here
==
There is no extra whitespace here
StringManip.tests.cpp:<line number>: PASSED:
REQUIRE( trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) )
with expansion:
There is no extra whitespace here
==
There is no extra whitespace here
-------------------------------------------------------------------------------
Unexpected exceptions can be translated
-------------------------------------------------------------------------------
@@ -12456,5 +12484,5 @@ Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 300 | 210 passed | 86 failed | 4 failed as expected
assertions: 1575 | 1406 passed | 148 failed | 21 failed as expected
assertions: 1579 | 1410 passed | 148 failed | 21 failed as expected

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="132" tests="1576" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="132" tests="1580" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
<property name="random-seed" value="1"/>

View File

@@ -11854,6 +11854,46 @@ Message from section two
"There is no extra whitespace here"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
<Original>
trim(StringRef(no_whitespace)) == StringRef(no_whitespace)
</Original>
<Expanded>
There is no extra whitespace here
==
There is no extra whitespace here
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
<Original>
trim(StringRef(leading_whitespace)) == StringRef(no_whitespace)
</Original>
<Expanded>
There is no extra whitespace here
==
There is no extra whitespace here
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
<Original>
trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace)
</Original>
<Expanded>
There is no extra whitespace here
==
There is no extra whitespace here
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
<Original>
trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace)
</Original>
<Expanded>
There is no extra whitespace here
==
There is no extra whitespace here
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Unexpected exceptions can be translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
@@ -14821,7 +14861,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="1406" failures="149" expectedFailures="21"/>
<OverallResults successes="1410" failures="149" expectedFailures="21"/>
</Group>
<OverallResults successes="1406" failures="148" expectedFailures="21"/>
<OverallResults successes="1410" failures="148" expectedFailures="21"/>
</Catch>