Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize line endings in ParsingEntryPointsTests #66

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: pr-validation

on:
pull_request:
branches:
- main
pull_request

jobs:
build:
Expand Down
5 changes: 4 additions & 1 deletion Test/SqlDom/ParsingEntryPointsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.SqlServer.TransactSql.ScriptDom;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SqlStudio.Tests.AssemblyTools.TestCategory;
Expand Down Expand Up @@ -67,7 +68,9 @@ void TestEntryPoint<T>(EntryPoint<T> entryPoint, SqlScriptGenerator scriptGen, s
reader.Close();
Assert.IsNotNull(actual);
Assert.AreEqual<int>(0, errors.Count);
Assert.AreEqual<string>(script, GenerateSource(scriptGen, actual));
string normalizedScript = Regex.Replace(script, @"\r\n|\n\r|\n|\r", Environment.NewLine);
string normalizedActual = Regex.Replace(GenerateSource(scriptGen, actual), @"\r\n|\n\r|\n|\r", Environment.NewLine);
Assert.AreEqual<string>(normalizedScript, normalizedActual);
}
}

Expand Down
Loading