Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce40fb1

Browse files
committed
Add overload tests from#131
1 parenta343b34 commitce40fb1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎src/tests/test_method.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,3 +743,29 @@ def test_we_can_bind_to_encoding_get_string():
743743

744744
data=''.join(data)
745745
assertdata=='Some testing string'
746+
747+
748+
deftest_wrong_overload():
749+
"""Test regression in which implicit conversion caused the wrong types
750+
to be used. See #131 for issue. Fixed by #137, #151"""
751+
752+
# Used to return `50L`
753+
res=System.Math.Abs(50.5)
754+
assertres==50.5
755+
asserttype(res)==float
756+
757+
res=System.Math.Abs(-50.5)
758+
assertres==50.5
759+
asserttype(res)==float
760+
761+
res=System.Math.Max(50.5,50.1)
762+
assertres==50.5
763+
asserttype(res)==float
764+
765+
res=System.Math.Max(System.Double(10.5),System.Double(50.5))
766+
assertres==50.5
767+
asserttype(res)==float# Should it return a System.Double?
768+
769+
res=System.Math.Max(System.Double(50.5),50.1)
770+
assertres==50.5
771+
asserttype(res)==float

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp