浏览代码

String compare for generated shader tests should not care about whitespace (we use platform native when generating so there can be differences between windows / mac)

/main
Tim Cooper 7 年前
当前提交
c54ee0eb
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/ShaderGenerationTest.cs

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/ShaderGenerationTest.cs


using System;
using System.Globalization;
using System.IO;
using System.Linq;
using NUnit.Framework;

else
{
var textTemplate = File.ReadAllText(textTemplateFilePath);
var textsAreEqual = shaderString == textTemplate;
var textsAreEqual = string.Compare(shaderString, textTemplate, CultureInfo.CurrentCulture, CompareOptions.IgnoreSymbols);
if (!textsAreEqual)
if (0 != textsAreEqual)
{
var failedPath = Path.Combine(rootPath.ToString(), "Failed");
Directory.CreateDirectory(failedPath);

File.WriteAllText(misMatchLocationResult, shaderString);
File.WriteAllText(misMatchLocationTemplate, textTemplate);
}
Assert.IsTrue(textsAreEqual);
Assert.IsTrue(textsAreEqual == 0);
}
m_Shader = ShaderUtil.CreateShaderAsset(shaderString);

正在加载...
取消
保存