Add more tests for C++11 raw string literals

Test added to check fixes for:

- Issue #948 and issue #1019 and issue #1273 - raw string delimiters
  not being stripped off
- Issue #538 - Ruby support for "docstring" feature
This commit is contained in:
William S Fulton 2019-01-05 23:54:02 +00:00
commit 0c4491eaae
4 changed files with 140 additions and 0 deletions

View file

@ -59,3 +59,43 @@ const char16_t *hh = uR"XXX(I'm a "raw UTF-16" \ string.)XXX";
const char32_t *ii = UR"XXX(I'm a "raw UTF-32" \ string.)XXX";
%}
// Constants
#if defined(SWIGJAVA)
%javaconst(1);
#elif SWIGCSHARP
%csconst(1);
#elif SWIGD
%dmanifestconst;
#endif
%inline %{
#define jj ")I'm an \"ascii\" \\ string constant."
#define kk R"XXX()I'm an "ascii" \ string constant.)XXX";
%}
%constant mm = R"XXX()I'm an "ascii" \ string constant with multiple
lines.)XXX";
// docstring feature
%feature("docstring") RawStringDoc::WW "Single line documentation comment"
%feature("docstring") RawStringDoc::XX %{
Multi-line
documentation
comment
%}
%feature("docstring") RawStringDoc::YY R"RRR(Single line "raw string" documentation comment)RRR"
%feature("docstring") RawStringDoc::ZZ R"FOO(Documentation comment
as a "raw string"
on multiple lines including a \ backslash)FOO"
%inline %{
struct RawStringDoc {
void WW() {}
void XX() {}
void YY() {}
void ZZ() {}
};
%}