-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11840 from dotnet/main
Merge main into 10.0
- Loading branch information
Showing
66 changed files
with
498 additions
and
261 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/xlf/SR.zh-Hant.xlf
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/System.Windows.Forms.Analyzers.CodeFixes.VisualBasic/Resources/xlf/SR.zh-Hant.xlf
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/System.Windows.Forms.Primitives/tests/TestUtilities.Tests/PathLengthTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using FluentAssertions; | ||
using System.IO.Enumeration; | ||
|
||
namespace System.Tests; | ||
|
||
public class PathLengthTests | ||
{ | ||
[Fact] | ||
public void RepoPathsLeaveRoomForRoot() | ||
{ | ||
string currentPath = typeof(PathLengthTests).Assembly.Location; | ||
currentPath = Path.GetFullPath(@"..\..\..\..\..\..\src", currentPath); | ||
Directory.Exists(currentPath).Should().BeTrue(); | ||
|
||
// Current path will be something like C:\Users\jkuhne\source\repos\winforms\src (41 chars, 38 without src). | ||
// We want to reserve 40 characters of the path length for everything past src. | ||
int currentRootLength = currentPath.Length - "src".Length; | ||
|
||
const int MaxRootLength = 40; | ||
|
||
int maxLength = 260 - (currentRootLength > MaxRootLength | ||
? MaxRootLength | ||
: MaxRootLength + (MaxRootLength - currentRootLength)); | ||
|
||
FileSystemEnumerable<string> enumerable = new( | ||
currentPath, | ||
(ref FileSystemEntry entry) => entry.ToFullPath(), | ||
new EnumerationOptions() { RecurseSubdirectories = true }) | ||
{ | ||
ShouldIncludePredicate = (ref FileSystemEntry entry) => | ||
// Directory doesn't contain a trailing slash | ||
entry.Directory.Length + entry.FileName.Length > maxLength | ||
}; | ||
|
||
enumerable.Should().BeEmpty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.