| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,6 +116,21 @@ public static int[] TestOverloadedParams(int v, int[] args) | |||
| 116 | 116 | return args; | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | + public static string TestOverloadedNoObject(int i) | ||
| 120 | + { | ||
| 121 | + return "Got int"; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public static string TestOverloadedObject(int i) | ||
| 125 | + { | ||
| 126 | + return "Got int"; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public static string TestOverloadedObject(object o) | ||
| 130 | + { | ||
| 131 | + return "Got object"; | ||
| 132 | + } | ||
| 133 | + | ||
| 119 | 134 | public static bool TestStringOutParams(string s, out string s1) | |
| 120 | 135 | { | |
| 121 | 136 | s1 = "output string"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -769,3 +769,25 @@ def test_wrong_overload(): | |||
| 769 | 769 | res = System.Math.Max(System.Double(50.5), 50.1) | |
| 770 | 770 | assert res == 50.5 | |
| 771 | 771 | assert type(res) == float | |
| 772 | + | ||
| 773 | + | ||
| 774 | + def test_no_object_in_param(): | ||
| 775 | + """Test that fix for #203 doesn't break behavior w/ no object overload""" | ||
| 776 | + | ||
| 777 | + res = MethodTest.TestOverloadedNoObject(5) | ||
| 778 | + assert res == "Got int" | ||
| 779 | + | ||
| 780 | + with pytest.raises(TypeError): | ||
| 781 | + MethodTest.TestOverloadedNoObject("test") | ||
| 782 | + | ||
| 783 | + | ||
| 784 | + @pytest.mark.xfail(reason="Needs fixing. #203") | ||
| 785 | + def test_object_in_param(): | ||
| 786 | + """Test regression introduced by #151 in which Object method overloads | ||
| 787 | + aren't being used. See #203 for issue.""" | ||
| 788 | + | ||
| 789 | + res = MethodTest.TestOverloadedObject(5) | ||
| 790 | + assert res == "Got int" | ||
| 791 | + | ||
| 792 | + res = MethodTest.TestOverloadedObject("test") | ||
| 793 | + assert res == "Got object" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments