Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit de96dec

Browse files
committed
Fixing osx filesystem test customizing assert per driver format
Fixes #30472
1 parent a69961a commit de96dec

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,23 @@ public void TimesIncludeMillisecondPart_Windows()
143143
public void TimesIncludeMillisecondPart_OSX()
144144
{
145145
T item = GetExistingItem();
146-
Assert.All(TimeFunctions(), (function) =>
146+
string driveFormat = new DriveInfo(Path.GetTempPath()).DriveFormat;
147+
if (driveFormat.Equals("hfs", StringComparison.InvariantCultureIgnoreCase))
147148
{
148-
DateTime time = function.Getter(item);
149-
Assert.Equal(0, time.Millisecond);
150-
});
149+
Assert.All(TimeFunctions(), (function) =>
150+
{
151+
DateTime time = function.Getter(item);
152+
Assert.Equal(0, time.Millisecond);
153+
});
154+
}
155+
else
156+
{
157+
Assert.All(TimeFunctions(), (function) =>
158+
{
159+
DateTime time = function.Getter(item);
160+
Assert.NotEqual(0, time.Millisecond);
161+
});
162+
}
151163
}
152164

153165
protected void ValidateSetTimes(T item, DateTime beforeTime, DateTime afterTime)

0 commit comments

Comments
 (0)