Skip to content

Commit

Permalink
Fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowFoxNixill committed Jan 13, 2020
1 parent 72a226b commit c628bb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CS-NixLib-Test/src/GridTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.IO;
using System;
using NUnit.Framework;
using Nixill.Collections.Grid;
Expand Down Expand Up @@ -55,6 +56,16 @@ public void GridManipTest() {
toCSVAgain = CSVParser.GridToString(toGrid);

Assert.AreEqual(toCSV, toCSVAgain);

// Now test files
string tmp = Path.GetTempPath();
string file = tmp + "test.csv";

CSVParser.GridToFile(testingGrid, file);
toGrid = CSVParser.FileToGrid(file);
toCSVAgain = CSVParser.GridToString(toGrid);

Assert.AreEqual(toCSV, toCSVAgain);
}
}
}
2 changes: 1 addition & 1 deletion CS-NixLib/src/Grid/CSVParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static string GridToString<T>(IGrid<T> input) {
public static void GridToFile<T>(IGrid<T> input, string file) {
using (StreamWriter writer = new StreamWriter(file)) {
foreach (string line in GridToStringEnumerable(input)) {
writer.WriteLine(input);
writer.WriteLine(line);
}
}
}
Expand Down

0 comments on commit c628bb6

Please sign in to comment.