Skip to content

Improve method binding #974

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test for ienumerable method
  • Loading branch information
koubaa committed Dec 1, 2019
commit 21528ee2fd3cbda2c9c7a9d7d884b71fb181ff2e
5 changes: 5 additions & 0 deletions src/testing/methodtest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public static int[] TestOverloadedParams(int v, int[] args)
return args;
}

public static int TestIEnumerable(System.Collections.Generic.IEnumerable<object> arg)
{
return 1;
}

public static string TestOverloadedNoObject(int i)
{
return "Got int";
Expand Down
5 changes: 5 additions & 0 deletions src/tests/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ def test_null_array_conversion():
r = ob.TestNullArrayConversion(None)
assert r is None

def test_ienumerable_args():
"""Test conversion of python lists and tuples to IEnumerable<object>"""
ob = MethodTest()
x = ob.TestIEnumerable([1,2,3])
y = ob.TestIEnumerable((1,2,3))

def test_string_params_args():
"""Test use of string params."""
Expand Down