Skip to content

Commit 1816faf

Browse files
committed
Fixed some unit test issues on Linux.
1 parent 2272dc0 commit 1816faf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/SparkDevNetwork.Rock.CodeGenerator.Tests/ListBlock/ListBlockGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public Task GeneratedFilesProducesExpectedOutput()
345345
Assert.Equal( GeneratedFileSaveState.NotProcessed, files[2].SaveState );
346346

347347
Assert.Equal( "types.partial.ts", files[3].FileName );
348-
Assert.Equal( "Rock.JavaScript.Obsidian.Blocks\\src\\Core\\MyObjectList\\types.partial.ts", files[3].SolutionRelativePath );
348+
Assert.Equal( "Rock.JavaScript.Obsidian.Blocks\\src\\Core\\MyObjectList\\types.partial.ts", files[3].SolutionRelativePath.Replace( '/', '\\' ) );
349349
Assert.Equal( GeneratedFileSaveState.NotProcessed, files[3].SaveState );
350350

351351
return Task.WhenAll(

src/SparkDevNetwork.Rock.CodeGenerator/Documentation/XmlComment.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ internal static string GetContent( XPathNavigator node )
7575
// Determine the indentation size of the text.
7676
int indentSize = GetIndentSize( node );
7777

78-
var textLines = text.Split( new string[] { "\r\n" }, StringSplitOptions.None )
78+
// XmlDocument will normalize \r\n to \n on platforms
79+
// that only use \n so we need to split for both patterns.
80+
var textLines = text.Split( new string[] { "\r\n", "\n" }, StringSplitOptions.None )
7981
.Select( t => t.SubstringSafe( indentSize ) )
8082
.ToList();
8183

@@ -130,7 +132,9 @@ internal static string GetPlainText( XPathNavigator node )
130132
// Determine the indentation size of the text.
131133
int indentSize = GetIndentSize( node );
132134

133-
var textLines = text.Split( new string[] { "\r\n" }, StringSplitOptions.None )
135+
// XmlDocument will normalize \r\n to \n on platforms
136+
// that only use \n so we need to split for both patterns.
137+
var textLines = text.Split( new string[] { "\r\n", "\n" }, StringSplitOptions.None )
134138
.Select( t => t.SubstringSafe( indentSize ) )
135139
.ToList();
136140

0 commit comments

Comments
 (0)