Skip to content

Commit 2c056d7

Browse files
Test that current conversion has the correct behaviour on decimals
Guards against breaking currently correct behaviour regarding #238
1 parent 7e02130 commit 2c056d7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

TestData/SelfVerifyingTests/VBToCS/ExpressionTests.vb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ Module Program
2424
Assert.Equal(x, 3.5D)
2525
End Sub
2626

27+
<Fact>
28+
Public Sub TestIntFunctionFloorsDecimal() 'https://github.com/icsharpcode/CodeConverter/issues/238
29+
Dim a = 30.4
30+
Dim b = 20.5
31+
Dim c = 10.6
32+
Dim d = -10.4
33+
Dim e = -20.5
34+
Dim f = -30.6
35+
Assert.Equal(30, Int(a))
36+
Assert.Equal(20, Int(b))
37+
Assert.Equal(10, Int(c))
38+
Assert.Equal(-11, Int(d))
39+
Assert.Equal(-21, Int(e))
40+
Assert.Equal(-31, Int(f))
41+
End Sub
42+
2743
<Fact(Skip := "https://github.com/icsharpcode/CodeConverter/issues/105")>
2844
Public Sub EmptyStringEqualityToNull()
2945
Dim s As String = ""

0 commit comments

Comments
 (0)