fix: Fixes Point3D.Parse (#1305)
This commit is contained in:
parent
43d33759df
commit
c266294e31
2 changed files with 3 additions and 1 deletions
|
|
@ -12,6 +12,8 @@ public class Point3DTests
|
|||
var successful = Point3D.TryParse(text, null, out var p);
|
||||
Assert.True(successful);
|
||||
Assert.Equal(new Point3D(x, y, z), p);
|
||||
|
||||
Assert.Equal(new Point3D(x, y, z), Point3D.Parse(text, null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public struct Point3D
|
|||
var offset = firstComma + 1;
|
||||
|
||||
var secondComma = s[offset..].IndexOfOrdinal(',');
|
||||
if (secondComma == -1 || offset == secondComma)
|
||||
if (secondComma == -1)
|
||||
{
|
||||
throw new FormatException($"The input string '{s}' was not in a correct format.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue