Skip to content

Commit ee23b92

Browse files
authored
sln-list: Fix char conversions (#44661)
1 parent befb30c commit ee23b92

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Cli/dotnet/commands/dotnet-sln/list/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private async Task ListAllProjectsAsync(string solutionFileFullPath, Cancellatio
4646
{
4747
paths = solution.SolutionFolders
4848
// VS-SolutionPersistence does not return a path object, so there might be issues with forward/backward slashes on different platforms
49-
.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart("/")))
49+
.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/')))
5050
.ToArray();
5151
}
5252
else

test/dotnet-sln.Tests/GivenDotnetSlnList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void WhenInvalidSolutionIsPassedItPrintsErrorAndUsage(string solutionComm
101101
.Execute(solutionCommand, "InvalidSolution.sln", "list");
102102
cmd.Should().Fail();
103103
cmd.StdErr.Should().Contain(
104-
string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, "InvalidSolution.sln"), "").TrimEnd("."));
104+
string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, "InvalidSolution.sln"), "").TrimEnd('.'));
105105
cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized("");
106106
}
107107

@@ -121,7 +121,7 @@ public void WhenInvalidSolutionIsFoundListPrintsErrorAndUsage(string solutionCom
121121
.Execute(solutionCommand, "list");
122122
cmd.Should().Fail();
123123
cmd.StdErr.Should().Contain(
124-
string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionFullPath, "").TrimEnd("."));
124+
string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionFullPath, "").TrimEnd('.'));
125125
cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized("");
126126
}
127127

0 commit comments

Comments
 (0)