Add "unicode_strings" test case for new Python 3 behavior
This commit is contained in:
parent
9846f3f1ea
commit
791f070e66
3 changed files with 20 additions and 0 deletions
|
|
@ -473,6 +473,7 @@ CPP_TEST_CASES += \
|
||||||
typemap_various \
|
typemap_various \
|
||||||
typename \
|
typename \
|
||||||
types_directive \
|
types_directive \
|
||||||
|
unicode_strings \
|
||||||
union_scope \
|
union_scope \
|
||||||
using1 \
|
using1 \
|
||||||
using2 \
|
using2 \
|
||||||
|
|
|
||||||
4
Examples/test-suite/python/unicode_strings_runme.py
Normal file
4
Examples/test-suite/python/unicode_strings_runme.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import unicode_strings
|
||||||
|
|
||||||
|
unicode_strings.test_c_str()
|
||||||
|
unicode_strings.test_std_string()
|
||||||
15
Examples/test-suite/unicode_strings.i
Normal file
15
Examples/test-suite/unicode_strings.i
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
%module unicode_strings
|
||||||
|
|
||||||
|
%include <std_string.i>
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
const char* test_c_str(void) {
|
||||||
|
return "h\xe9llo";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string test_std_string(void) {
|
||||||
|
return std::string("h\xe9llo");
|
||||||
|
}
|
||||||
|
|
||||||
|
%}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue