Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 73e2d09

Browse filesBrowse files
committed
Add unit test for String::isEmpty()
1 parent cb3ab4c commit 73e2d09
Copy full SHA for 73e2d09

File tree

1 file changed

+29
-0
lines changed
Filter options

1 file changed

+29
-0
lines changed

‎test/src/String/test_isEmpty.cpp

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2023 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <api/String.h>
12+
13+
#include "StringPrinter.h"
14+
15+
/**************************************************************************************
16+
* TEST CODE
17+
**************************************************************************************/
18+
19+
TEST_CASE ("Testing String::isEmpty when string is empty", "[String-isEmpty-01]")
20+
{
21+
arduino::String str;
22+
REQUIRE(str.isEmpty());
23+
}
24+
25+
TEST_CASE ("Testing String::isEmpty when string contains characters", "[String-isEmpty-02]")
26+
{
27+
arduino::String str("Testing String::isEmpty");
28+
REQUIRE(!str.isEmpty());
29+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.