| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -769,3 +769,53 @@ def test_wrong_overload(): | |
| res = System.Math.Max(System.Double(50.5), 50.1) | ||
| assert res == 50.5 | ||
| assert type(res) == float | ||
|
|
||
|
|
||
| def test_no_object_in_param(): | ||
| """Test that fix for #203 doesn't break behavior w/ no object overload""" | ||
|
|
||
| res = MethodTest.TestOverloadedNoObject(5) | ||
| assert res == "Got int" | ||
|
|
||
| with pytest.raises(TypeError): | ||
| MethodTest.TestOverloadedNoObject("test") | ||
|
|
||
|
|
||
| def test_object_in_param(): | ||
| """Test regression introduced by #151 in which Object method overloads | ||
| aren't being used. See #203 for issue.""" | ||
|
|
||
| res = MethodTest.TestOverloadedObject(5) | ||
| assert res == "Got int" | ||
|
|
||
| res = MethodTest.TestOverloadedObject("test") | ||
| assert res == "Got object" | ||
|
|
||
|
|
||
| def test_object_in_multiparam(): | ||
| """Test method with object multiparams behaves""" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo(5, 5) | ||
| assert res == "Got int-int" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo(5, "foo") | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitywill this break if you add: public static string TestOverloadedObjectTwo(int a, string b)
{
return "Got int-string";
}
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNow its there.
Sorry, something went wrong.
All reactions
|
||
| assert res == "Got int-string" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo("foo", 7.24) | ||
| assert res == "Got string-object" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo("foo", "bar") | ||
| assert res == "Got string-string" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo("foo", 5) | ||
| assert res == "Got string-int" | ||
|
|
||
| res = MethodTest.TestOverloadedObjectTwo(7.24, 7.24) | ||
| assert res == "Got object-object" | ||
|
|
||
|
|
||
| def test_object_in_multiparam_exception(): | ||
| """Test method with object multiparams behaves""" | ||
|
|
||
| with pytest.raises(TypeError): | ||
| MethodTest.TestOverloadedObjectThree("foo", "bar") | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityyou don't test this method in python
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitybecause you changed the test for it above. I re-added a test for it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.