-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#989: Trim script class and import script options #465
#989: Trim script class and import script options #465
Conversation
inline void ltrim(std::string &s) { | ||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) { | ||
return !std::isspace(ch); | ||
})); | ||
} | ||
|
||
|
||
inline void rtrim(std::string &s) { | ||
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { | ||
return !std::isspace(ch); | ||
}).base(), s.end()); | ||
} | ||
|
||
inline void trim(std::string &s) { | ||
ltrim(s); | ||
rtrim(s); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from https://stackoverflow.com/a/217605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the link as comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
235772a
to
1691e48
Compare
@@ -156,6 +199,47 @@ TEST(JavaContainer, simple_import_script) { | |||
EXPECT_EQ(vm.getJavaVMInternalStatus().m_jvmOptions, expectedJVMOptions); | |||
} | |||
|
|||
TEST(JavaContainer, simple_import_script_with_white_space) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense also to add a test with a quoted import script, because it is legal
…n order to avoid memory leak if exception in SWIGVMContainers::JavaVMImpl::JavaVMImpl() occurs.
2adeb77
to
f552241
Compare
Related to exasol/script-languages-release#989