You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
using System.Text.RegularExpressions;
|
|
using UnityEngine.TestTools.Logging;
|
|
|
|
namespace UnityEngine.TestTools
|
|
{
|
|
public static class LogAssert
|
|
{
|
|
public static void Expect(LogType type, string message)
|
|
{
|
|
LogScope.Current.ExpectedLogs.Enqueue(new LogMatch() { LogType = type, Message = message });
|
|
}
|
|
|
|
public static void Expect(LogType type, Regex message)
|
|
{
|
|
LogScope.Current.ExpectedLogs.Enqueue(new LogMatch() { LogType = type, MessageRegex = message });
|
|
}
|
|
|
|
public static void NoUnexpectedReceived()
|
|
{
|
|
LogScope.Current.NoUnexpectedReceived();
|
|
}
|
|
|
|
public static bool ignoreFailingMessages
|
|
{
|
|
get
|
|
{
|
|
return LogScope.Current.IgnoreFailingMessages;
|
|
}
|
|
set
|
|
{
|
|
if (value != LogScope.Current.IgnoreFailingMessages)
|
|
{
|
|
Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, "\nIgnoreFailingMessages:" + (value? "true":"false"));
|
|
}
|
|
LogScope.Current.IgnoreFailingMessages = value;
|
|
}
|
|
}
|
|
}
|
|
}
|