public void DataSetBicepLineEndingsShouldMatchDataSetNameSuffix(DataSet dataSet) { var lineEndingTokens = GetLineEndingTokens(dataSet.Bicep); lineEndingTokens.Select(token => token.Type).Should().AllBeEquivalentTo(TokenType.NewLine); var expectedPattern = dataSet.HasCrLfNewlines() ? Pattern_CRLF : Pattern_LF; lineEndingTokens.All(token => expectedPattern.IsMatch(token.Text)).Should().BeTrue(); }
public static string AddDiagsToSourceText <TPositionable>(DataSet dataSet, IEnumerable <TPositionable> items, Func <TPositionable, string> diagsFunc) where TPositionable : IPositionable => OutputHelper.AddDiagsToSourceText(dataSet.Bicep, dataSet.HasCrLfNewlines() ? "\r\n" : "\n", items, item => item.Span, diagsFunc);
public static string AddDiagsToSourceText <T>(DataSet dataSet, IEnumerable <T> items, Func <T, TextSpan> getSpanFunc, Func <T, string> diagsFunc) => OutputHelper.AddDiagsToSourceText <T>(dataSet.Bicep, dataSet.HasCrLfNewlines() ? "\r\n" : "\n", items, getSpanFunc, diagsFunc);