Skip to content

Commit 828df74

Browse files
Copilotjosesimoes
andcommitted
Add specific test cases from issue #1650 sample code (9.8999 and 99.8999)
Co-authored-by: josesimoes <[email protected]>
1 parent aad6a98 commit 828df74

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/NFUnitTestArithmetic/UnitTestFormat.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ public void FixedFormat()
127127
TestFormat("1234.8999", "F3", "1234.900");
128128
TestFormat("1234.8999", "F0", "1235");
129129
TestFormat("-1234.8999", "F0", "-1235");
130+
// Test cases from issue #1650
131+
TestFormat("9.8999", "F", "9.90");
132+
TestFormat("9.8999", "F0", "10");
133+
TestFormat("9.8999", "F1", "9.9");
134+
TestFormat("99.8999", "F", "99.90");
135+
TestFormat("99.8999", "F0", "100");
136+
TestFormat("99.8999", "F1", "99.9");
130137

131138
sampleDisplay.WriteOutput();
132139

@@ -277,6 +284,13 @@ public void NumberFormat()
277284
TestFormat("1234567.1210", "N0", "1,234,567");
278285
TestFormat("-0.099999999999999978", "N2", "-0.10");
279286
TestFormat("-0.099999999999999978", "N0", "0");
287+
// Test cases from issue #1650
288+
TestFormat("9.8999", "N", "9.90");
289+
TestFormat("9.8999", "N0", "10");
290+
TestFormat("9.8999", "N1", "9.9");
291+
TestFormat("99.8999", "N", "99.90");
292+
TestFormat("99.8999", "N0", "100");
293+
TestFormat("99.8999", "N1", "99.9");
280294
sampleDisplay.WriteOutput();
281295
}
282296

0 commit comments

Comments
 (0)