Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #305 from yaakov-h/pr-PathGetTempFileName
Browse files Browse the repository at this point in the history
Extend postcondition on Path.GetTempFileName
  • Loading branch information
SergeyTeplyakov committed Nov 20, 2015
2 parents bd2c4c4 + 9fccb9d commit 366e422
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Microsoft.Research/Contracts/MsCorlib/System.IO.Path.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public static string GetRandomFileName()

public static string GetTempFileName()
{
Contract.Ensures(Contract.Result<string>() != null);
Contract.Ensures(!string.IsNullOrWhitespace(Contract.Result<string>()));
Contract.Ensures(Contract.Result<string>().Length >= 4);
Contract.EnsuresOnThrow<System.IO.IOException>(true, @"An I/O error occurs, such as no unique temporary file name is available. - or - This method was unable to create a temporary file.");
return default(string);
}
Expand Down

0 comments on commit 366e422

Please sign in to comment.