File tree 2 files changed +37
-1
lines changed
2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 10
10
#ifndef XEUS_CPP_PARSER_HPP
11
11
#define XEUS_CPP_PARSER_HPP
12
12
13
+ #include " xeus-cpp/xeus_cpp_config.hpp"
14
+
13
15
#include < string>
14
16
15
17
namespace xcpp
16
- {
18
+ {
19
+ XEUS_CPP_API
17
20
std::string trim (const std::string& str);
18
21
}
19
22
#endif
Original file line number Diff line number Diff line change 12
12
#include " xeus-cpp/xmanager.hpp"
13
13
#include " xeus-cpp/xutils.hpp"
14
14
15
+ #include " ../src/xparser.hpp"
16
+
15
17
TEST_SUITE (" execute_request" )
16
18
{
17
19
TEST_CASE (" fetch_documentation" )
@@ -50,6 +52,37 @@ TEST_SUITE("extract_filename")
50
52
}
51
53
}
52
54
55
+ TEST_SUITE (" trim" ){
56
+
57
+ TEST_CASE (" trim_basic_test" ){
58
+ std::string argument = " argument" ;
59
+
60
+ std::string result = xcpp::trim (argument);
61
+
62
+ REQUIRE (result == " argument" );
63
+ }
64
+
65
+ /* Checks if it trims the string which
66
+ has an empty space at the start and in the end*/
67
+ TEST_CASE (" trim_start_and_end" ){
68
+ std::string argument = " argument " ;
69
+
70
+ std::string result = xcpp::trim (argument);
71
+
72
+ REQUIRE (result == " argument" );
73
+ }
74
+
75
+ /* Checks if it trims the string which has no characters*/
76
+ TEST_CASE (" trim_empty" ){
77
+ std::string argument = " " ;
78
+
79
+ std::string result = xcpp::trim (argument);
80
+
81
+ REQUIRE (result == " " );
82
+ }
83
+
84
+ }
85
+
53
86
TEST_SUITE (" should_print_version" )
54
87
{
55
88
// This test case checks if the function `should_print_version` correctly identifies
You can’t perform that action at this time.
0 commit comments