From aa21464bd8db25504185ea679d2c69d21e30e19f Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Mon, 2 Oct 2023 08:29:39 +0300 Subject: [PATCH] fix import/export tests on Windows 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. --- Test/Integration/TableTest.cs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Test/Integration/TableTest.cs b/Test/Integration/TableTest.cs index f18c50e..6af8db9 100644 --- a/Test/Integration/TableTest.cs +++ b/Test/Integration/TableTest.cs @@ -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); @@ -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); @@ -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); @@ -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);