Add autodoc and keyword argument tests
This commit is contained in:
parent
1329ed7a5c
commit
721f6ddef1
3 changed files with 28 additions and 5 deletions
|
|
@ -149,10 +149,21 @@ bool is_python_builtin() { return false; }
|
|||
#endif
|
||||
%}
|
||||
|
||||
// Autodoc Python keywords
|
||||
%warnfilter(SWIGWARN_PARSE_KEYWORD) process;
|
||||
%feature(autodoc,0) process;
|
||||
// Autodoc language keywords
|
||||
%feature(autodoc,1) process;
|
||||
%feature(autodoc,1) process2;
|
||||
%feature("compactdefaultargs") process;
|
||||
%feature("compactdefaultargs") process2;
|
||||
%inline %{
|
||||
int process(int from) { return from; }
|
||||
int process(int from, int in, int var) { return from; }
|
||||
int process2(int from = 0, int _in = 1, int var = 2) { return from; }
|
||||
%}
|
||||
|
||||
%feature(autodoc,1) process3;
|
||||
%feature(autodoc,1) process4;
|
||||
%feature("kwargs") process3;
|
||||
%feature("kwargs") process4;
|
||||
%inline %{
|
||||
int process3(int from, int _in, int var) { return from; }
|
||||
int process4(int from = 0, int _in = 1, int var = 2) { return from; }
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -203,4 +203,7 @@ check(inspect.getdoc(TInteger), "Proxy of C++ T< int > class.", "::T< int >")
|
|||
check(inspect.getdoc(TInteger.__init__), "__init__(TInteger self) -> TInteger", None, skip)
|
||||
check(inspect.getdoc(TInteger.inout), "inout(TInteger self, TInteger t) -> TInteger")
|
||||
|
||||
check(inspect.getdoc(process), "process(_from) -> int")
|
||||
check(inspect.getdoc(process), "process(int _from, int _in, int var) -> int")
|
||||
check(inspect.getdoc(process2), "process2(int _from=0, int _in=1, int var=2) -> int")
|
||||
check(inspect.getdoc(process3), "process3(int _from, int _in, int var) -> int")
|
||||
check(inspect.getdoc(process4), "process4(int _from=0, int _in=1, int var=2) -> int")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue