Skip to content

Commit

Permalink
fix import/export tests on Windows
Browse files Browse the repository at this point in the history
When C# file has Unix line endings because Git is configured that way, it's unable to find the line end and complains about too many columns when importing. This fixes it to always specify the line endings in the tests explicitly when creating the temp files.
  • Loading branch information
keith-hall committed Oct 5, 2023
1 parent ebf104a commit aa21464
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions Test/Integration/TableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ public async Task TestExportData() {
await testDb.ExecSqlAsync(t.ScriptCreate());

var dataIn =
@"1 R Ready
2 P Processing
3 F Frozen
";
@"1 R Ready" + Environment.NewLine +
@"2 P Processing" + Environment.NewLine +
@"3 F Frozen" + Environment.NewLine;
var filename = Path.GetTempFileName();

var writer = File.AppendText(filename);
Expand Down Expand Up @@ -67,10 +66,9 @@ public async Task TestImportAndExportIgnoringComputedData() {
await testDb.ExecSqlAsync(t.ScriptCreate());

var dataIn =
@"1 R Ready
2 P Processing
3 F Frozen
";
@"1 R Ready" + Environment.NewLine +
@"2 P Processing" + Environment.NewLine +
@"3 F Frozen" + Environment.NewLine;
var filename = Path.GetTempFileName();

var writer = File.AppendText(filename);
Expand Down Expand Up @@ -100,10 +98,9 @@ public async Task TestImportAndExportDateTimeWithoutLosePrecision() {
await testDb.ExecSqlAsync(t.ScriptCreate());

var dataIn =
@"1 2017-02-21 11:20:30.1
2 2017-02-22 11:20:30.12
3 2017-02-23 11:20:30.123
";
@"1 2017-02-21 11:20:30.1" + Environment.NewLine +
@"2 2017-02-22 11:20:30.12" + Environment.NewLine +
@"3 2017-02-23 11:20:30.123" + Environment.NewLine;
var filename = Path.GetTempFileName();

var writer = File.AppendText(filename);
Expand Down Expand Up @@ -136,10 +133,9 @@ public async Task TestImportAndExportNonDefaultSchema() {
await testDb.ExecSqlAsync(t.ScriptCreate());

var dataIn =
@"1 R Ready
2 P Processing
3 F Frozen
";
@"1 R Ready" + Environment.NewLine +
@"2 P Processing" + Environment.NewLine +
@"3 F Frozen" + Environment.NewLine;
var filename = Path.GetTempFileName();

var writer = File.AppendText(filename);
Expand Down

0 comments on commit aa21464

Please sign in to comment.