Skip to content

Commit 66a3549

Browse files
authored
Merge pull request #22 from Atypical-Consulting/fix-test-vfs-tostring
Fix a group of broken tests (VFS.ToString method)
2 parents 02024bc + f610291 commit 66a3549

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Atypical.VirtualFileSystem.Core/VFS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public override string ToString()
8484
sb.AppendLine(node.Path.Name);
8585
}
8686

87-
return sb.ToString().Trim();
87+
return sb.ToString().Trim().ReplaceLineEndings();
8888
}
8989

9090
/// <summary>

tests/Atypical.VirtualFileSystem.UnitTests/Models/VirtualFileSystemTests.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,7 @@ public void ToString_returns_3_files_as_ASCII_tree()
480480
├── file1.txt
481481
├── file2.txt
482482
└── file3.txt
483-
"""
484-
.Replace("\r", "");
483+
""".ReplaceLineEndings();
485484

486485
var vfs = new VFS()
487486
.CreateFile("file1.txt")
@@ -504,8 +503,7 @@ public void ToString_returns_3_directories_as_ASCII_tree()
504503
├── dir1
505504
├── dir2
506505
└── dir3
507-
"""
508-
.Replace("\r", "");
506+
""".ReplaceLineEndings();
509507

510508
var vfs = new VFS()
511509
.CreateDirectory("dir1")
@@ -537,8 +535,7 @@ public void ToString_returns_3_files_and_3_directories_as_ASCII_tree()
537535
├── file1.txt
538536
├── file2.txt
539537
└── file3.txt
540-
"""
541-
.Replace("\r", "");
538+
""".ReplaceLineEndings();
542539

543540
var vfs = new VFS()
544541
.CreateFile("dir1/file1.txt")
@@ -588,8 +585,7 @@ public void ToString_returns_a_complex_tree()
588585
├── file1.txt
589586
├── file2.txt
590587
└── file3.txt
591-
"""
592-
.Replace("\r", "");
588+
""".ReplaceLineEndings();
593589

594590
var vfs = new VFS()
595591
.CreateFile("dir1/dir2/dir3/file1.txt")

0 commit comments

Comments
 (0)