---
title: "TestCreate"
language: "en"
type: "Symbol"
summary: "TestCreate[input] create a TestObject to determine whether input evaluates to True. TestCreate[input, expected] create a TestObject to determine whether input evaluates to expected. TestCreate[input, expected, messages] create a TestObject that is expected to generate the list of message names messages."
keywords: 
- automated testing
- bug testing
- development testing
- function test
- functional testing
- QA
- regression test
- regression testing
- retesting
- software testing
- SQA
- system test
- test
- testing
- unit test
- unit testing
canonical_url: "https://reference.wolfram.com/language/ref/TestCreate.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Systematic Testing & Verification"
    link: "https://reference.wolfram.com/language/guide/SystematicTestingAndVerification.en.md"
  - 
    title: "Tuning & Debugging"
    link: "https://reference.wolfram.com/language/guide/TuningAndDebugging.en.md"
related_workflows: 
  - 
    title: "Write Unit Tests"
    link: "https://reference.wolfram.com/language/workflow/WriteUnitTests.en.md"
related_functions: 
  - 
    title: "TestReport"
    link: "https://reference.wolfram.com/language/ref/TestReport.en.md"
  - 
    title: "TestObject"
    link: "https://reference.wolfram.com/language/ref/TestObject.en.md"
  - 
    title: "TestEvaluate"
    link: "https://reference.wolfram.com/language/ref/TestEvaluate.en.md"
  - 
    title: "IntermediateTest"
    link: "https://reference.wolfram.com/language/ref/IntermediateTest.en.md"
related_tutorials: 
  - 
    title: "Using Testing Notebooks"
    link: "https://reference.wolfram.com/language/tutorial/UsingTestingNotebooks.en.md"
  - 
    title: "Using the Testing Framework"
    link: "https://reference.wolfram.com/language/tutorial/UsingTheTestingFramework.en.md"
---
# TestCreate

TestCreate[input] create a TestObject to determine whether input evaluates to True.

TestCreate[input, expected] create a TestObject to determine whether input evaluates to expected.

TestCreate[input, expected, messages] create a TestObject that is expected to generate the list of message names messages.

## Details and Options

* ``TestCreate`` returns a ``TestObject``.

* ``TestCreate`` has attribute ``HoldAllComplete``, therefore it does not immediately evaluate ``input`` or ``expected``.

* Use ``TestReport`` or ``TestEvaluate`` to run a test created by ``TestCreate``.

* ``TestCreate`` has the following options:

|                   |           |                                                |
| :---------------- | :-------- | :--------------------------------------------- |
| MemoryConstraint  | Infinity  | memory (in bytes) the test is allowed to use   |
| MetaInformation   | <\|\|>    | extra information associated with the test     |
| SameTest          | SameQ     | function to compare actual and expected output |
| TestID            | Automatic | unique identifier for the test                 |
| TimeConstraint    | Infinity  | time (in seconds) the test is allowed to use   |

* ``TestID -> Automatic`` creates a unique ID by doing a hash of the test expression.

---

## Examples (22)

### Basic Examples (4)

Create a test that tests whether the input evaluates to ``True`` :

```wl
In[1]:= test = TestCreate[Sin[E] > Cos[E]]

Out[1]=
TestObject[Association["Outcome" -> "NotEvaluated", "FailureType" -> None, 
  "Input" -> HoldForm[Sin[E] > Cos[E]], "ExpectedOutput" -> HoldForm[True], 
  "ExpectedMessages" -> HoldForm[{}], "MetaInformation" -> None, 
  "AbsoluteTime" -> 3.907146005346056*^9, "SameTest" -> SameQ, 
  "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "8fab674a-8942-4f08-94e2-2ce247c500a3", 
  "TestID" -> "16cbjhi37lj28", "TestFileName" -> ""]]
```

Evaluate the test:

```wl
In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146005346056*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "8fab674a-89 ... ut" -> HoldForm[True], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000273`2.5866776448727458, "CPUTimeUsed" -> 0.0002670000000000172, 
  "MemoryUsed" -> 5856, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

Test whether the input evaluates to the expected output:

```wl
In[1]:= TestEvaluate[TestCreate[Expand[(1 + x) ^ 3], 1 + 3 x + 3 x^2 + x^3]]

Out[1]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146005473651*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "c23c2cea-dc ...  + 3*x + 3*x^2 + x^3], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000181`2.4081935727011765, "CPUTimeUsed" -> 0.0002049999999993446, 
  "MemoryUsed" -> 3976, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

When a test fails, it returns an outcome of Failure:

```wl
In[1]:= TestEvaluate[TestCreate[2 + 2, 3]]

Out[1]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146005562157*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "0537d2f2-df ... Form[4], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000065`1.9634283544748494, "CPUTimeUsed" -> 0.00006600000000034356, 
  "MemoryUsed" -> 3456, "IntermediateTestsTree" -> {}, "Outcome" -> "Failure", 
  "FailureType" -> "SameTestFailure"]]
```

---

When the input evaluates to the expected output but gives messages, the outcome is MessagesFailure:

```wl
In[1]:= TestEvaluate[TestCreate[(1/0), ComplexInfinity]]

Out[1]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146005676167*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "d4f9d068-43 ...  HoldForm[0^(-1)]]]}, 
  "AbsoluteTimeUsed" -> 0.000181`2.4081935727011765, "CPUTimeUsed" -> 0.0001820000000005706, 
  "MemoryUsed" -> 3960, "IntermediateTestsTree" -> {}, "Outcome" -> "MessagesFailure", 
  "FailureType" -> "SameMessagesFailure"]]
```

Add the expected message:

```wl
In[2]:= TestEvaluate[TestCreate[1 / 0, ComplexInfinity, {Power::infy}]]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146005720693*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "15e660ee-32 ... Form[Message[Power::infy, HoldForm[0^(-1)]]]}, 
  "AbsoluteTimeUsed" -> 0.000174`2.3910642461145915, "CPUTimeUsed" -> 0.0001760000000006201, 
  "MemoryUsed" -> 3840, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

### Scope (2)

#### Basic Uses (2)

Perform a test and present the results in a ``Dataset`` :

```wl
In[1]:=
test = TestEvaluate[TestCreate[1 / 0, ComplexInfinity]];
Dataset[test[All]]

Out[1]=
Dataset[Association["TestID" -> "0ia7s5ntzn8fu", "Outcome" -> "MessagesFailure", 
  "FailureType" -> "SameMessagesFailure", "Input" -> HoldForm[1/0], 
  "ExpectedOutput" -> HoldForm[ComplexInfinity], "ActualOutput" -> HoldForm[ComplexInfinity], 
   ... n" -> None, 
  "TestCreate" -> HoldForm[TestCreate[1/0, ComplexInfinity, {}, TestID -> "0ia7s5ntzn8fu", 
     SameTest -> SameQ, TimeConstraint -> Infinity, MemoryConstraint -> Infinity, 
     MetaInformation -> None]], "IntermediateTests" -> {}]]
```

---

Test if the results of an ``NIntegrate`` are numerically equivalent to ``Integrate`` by using an absolute tolerance:

```wl
In[1]:= NIntegrate[Sin[x], {x, 0, 2}] - Integrate[Sin[x], {x, 0, 2}]

Out[1]= 1.3322676295501878`*^-15

In[2]:=
TestEvaluate[TestCreate[
	Abs[NIntegrate[Sin[x], {x, 0, 2}] - Integrate[Sin[x], {x, 0, 2}]] < 10^-14, True
	]]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146006574925*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "7a90746d-a7 ... tput" -> HoldForm[True], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.014751`4.319336460841818, "CPUTimeUsed" -> 0.01578700000000044, 
  "MemoryUsed" -> 18712, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

This can also be done by using the ``SameTest`` option:

```wl
In[3]:=
test = TestCreate[
	NIntegrate[Sin[x], {x, 0, 2}], 
	Integrate[Sin[x], {x, 0, 2}], 
	SameTest -> (Abs[#1 - #2] ≤ 10^-14&)
	];

In[4]:= TestEvaluate[test]

Out[4]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146006628166*^9, 
  "SameTest" -> (Abs[#1 - #2] <= 10^(-14) & ), "SameMessages" -> Testing`MessageMatchQ, 
  "MemoryConstraint" -> Infinity, "TimeConstraint" -> Infinity, 
  " ... rm[1.4161468365471437], 
  "ActualMessages" -> {}, "AbsoluteTimeUsed" -> 0.003886`3.740017794095758, 
  "CPUTimeUsed" -> 0.0038709999999992917, "MemoryUsed" -> 8728, "IntermediateTestsTree" -> {}, 
  "Outcome" -> "Success", "FailureType" -> None]]
```

### Options (13)

#### MemoryConstraint (1)

Run a test until a memory limit is exceeded:

```wl
In[1]:= ByteCount[RandomImage[]]

Out[1]= 90424

In[2]:=
test = TestCreate[
	Head @ RandomImage[], 
	Image, 
	MemoryConstraint -> Quantity[80, "Kilobytes"]
	];

In[3]:= TestEvaluate[test]["ActualOutput"]

Out[3]=
Failure["MemoryConstrained", Association["MessageTemplate" :> TestEvaluate::cnsexd, 
  "MessageParameters" -> Association["Function" :> MemoryConstrained, 
    "Constraint" :> HoldForm[Quantity[80, "Kilobytes"]]]]]
```

#### SameTest (5)

Test whether the input is an integer:

```wl
In[1]:=
test = TestCreate[
	RandomInteger[{1, 10}], 
	_Integer, 
	SameTest -> MatchQ
	];

In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146006981694*^9, 
  "SameTest" -> MatchQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "862dd2ef-9 ... tput" -> HoldForm[10], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000068`1.983023910538228, "CPUTimeUsed" -> 0.00006500000000020378, 
  "MemoryUsed" -> 3392, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

Test if the absolute precision of the input is at least ``10^-12`` :

```wl
In[1]:=
test = TestCreate[
	1., 
	1. + 5 10.^-13, 
	SameTest -> (Abs[#1 - #2] ≤ 10^-12&)
	];

In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.9071460070528092*^9, 
  "SameTest" -> (Abs[#1 - #2] <= 10^(-12) & ), "SameMessages" -> Testing`MessageMatchQ, 
  "MemoryConstraint" -> Infinity, "TimeConstraint" -> Infinity, 
   ... put" -> HoldForm[1.], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000065`1.9634283544748452, "CPUTimeUsed" -> 0.00006000000000039307, 
  "MemoryUsed" -> 3392, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

Test if the relative precision is at least ``10^-5`` :

```wl
In[1]:=
test = TestCreate[
	1., 
	1.0001, 
	SameTest -> (Abs[(#1 - #2) / #2] ≤ 10^-5&)
	];

In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.90714600712473*^9, 
  "SameTest" -> (Abs[(#1 - #2)/#2] <= 10^(-5) & ), "SameMessages" -> Testing`MessageMatchQ, 
  "MemoryConstraint" -> Infinity, "TimeConstraint" -> Infinity, 
 ... rm[1.], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000061`1.9358448328427589, "CPUTimeUsed" -> 0.000058999999999365116, 
  "MemoryUsed" -> 3392, "IntermediateTestsTree" -> {}, "Outcome" -> "Failure", 
  "FailureType" -> "SameTestFailure"]]
```

---

Test if two expressions are equivalent after simplification:

```wl
In[1]:=
test = TestCreate[
	Cos[x]^2 + Sin[x]^2, 
	1, 
	SameTest -> (Simplify[#1] === Simplify[#2]&)
	];
TestEvaluate[test]

Out[1]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146007193598*^9, 
  "SameTest" -> (Simplify[#1] === Simplify[#2] & ), "SameMessages" -> Testing`MessageMatchQ, 
  "MemoryConstraint" -> Infinity, "TimeConstraint" -> Infinity, ... [Cos[x]^2 + Sin[x]^2], 
  "ActualMessages" -> {}, "AbsoluteTimeUsed" -> 0.000064`1.956694971815879, 
  "CPUTimeUsed" -> 0.00006500000000020378, "MemoryUsed" -> 3432, "IntermediateTestsTree" -> {}, 
  "Outcome" -> "Success", "FailureType" -> None]]
```

---

Use ``Unevaluated`` to pass unevaluated expressions to the ``SameTest`` function:

```wl
In[1]:= test = TestCreate[Unevaluated[RandomReal[]], Unevaluated[RandomReal[]]];

In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146007253736*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "258eadab-48 ... aluated[RandomReal[]]], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000066`1.97005893337386, "CPUTimeUsed" -> 0.00006099999999964467, 
  "MemoryUsed" -> 3400, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

You can use a combination of ``Function`` and ``Echo`` to print the arguments of the ``SameTest`` function:

```wl
In[3]:=
test = TestCreate[
	StringJoin[2], 
	Unevaluated[StringJoin[2]], 
	{StringJoin::string}, 
	SameTest -> Function[
	{left, right}, 
	SameQ @@Echo[HoldComplete[left, right]], 
	HoldAllComplete
	]
	];

In[4]:= TestEvaluate[test]

>> HoldComplete[StringJoin[2], Unevaluated[StringJoin[2]]]

Out[4]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146007300608*^9, 
  "SameTest" -> Function[{left, right}, SameQ @@ Echo[HoldComplete[left, right]], HoldAllComplete], 
  "SameMessages" -> Testing`MessageMatchQ, "MemoryConstr ... ng, HoldForm[1], 
      HoldForm[StringJoin[2]]]]}, "AbsoluteTimeUsed" -> 0.031267`4.645601211471849, 
  "CPUTimeUsed" -> 0.031153000000000652, "MemoryUsed" -> 5392, "IntermediateTestsTree" -> {}, 
  "Outcome" -> "Success", "FailureType" -> None]]
```

#### TestID (4)

Add a ``TestID`` to the test:

```wl
In[1]:= TestCreate[1 + 1, 2, TestID -> "myTestID"]

Out[1]=
TestObject[Association["Outcome" -> "NotEvaluated", "FailureType" -> None, 
  "Input" -> HoldForm[1 + 1], "ExpectedOutput" -> HoldForm[2], "ExpectedMessages" -> HoldForm[{}], 
  "MetaInformation" -> None, "AbsoluteTime" -> 3.907146007536967*^9, "SameTest" -> SameQ, 
  "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "a4884951-588c-4a7f-a8ce-ef45dc8dff70", 
  "TestID" -> "myTestID", "TestFileName" -> ""]]
```

---

A ``TestID`` can be any expression:

```wl
In[1]:=
Table[
	TestCreate[n + 2 > 0, True, TestID -> {"NumericTest", n}], 
	{n, 3}
	]

Out[1]=
{TestObject[Association["Outcome" -> "NotEvaluated", "FailureType" -> None, 
  "Input" -> HoldForm[n + 2 > 0], "ExpectedOutput" -> HoldForm[True], 
  "ExpectedMessages" -> HoldForm[{}], "MetaInformation" -> None, 
  "AbsoluteTime" -> 3.907146007625 ... 9, "SameTest" -> SameQ, 
  "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "53bbb87a-5aa5-42b1-92e4-1806f502f184", 
  "TestID" -> {"NumericTest", 3}, "TestFileName" -> ""]]}
```

---

By default, the ``TestID`` is a ``Hash`` of the test:

```wl
In[1]:= VerificationTest[2 + 2, 4]["TestID"]

Out[1]= "1duz99osblony"
```

The ``TestID`` will change if the input of the ``TestCreate`` expression is different:

```wl
In[2]:= VerificationTest[2 + 2, 5]["TestID"]

Out[2]= "0ck1nz2rfsry5"
```

---

Use ``CreateUUID`` to create random identifiers every time:

```wl
In[1]:= TestCreate[2 + 2, 5, TestID :> CreateUUID[]]["TestID"]

Out[1]= "641a284d-ee31-4496-8ee5-2957721ccdb7"
```

#### TimeConstraint (1)

Terminate the test if it takes more than one second:

```wl
In[1]:= test = TestCreate[Pause[2], Null, TimeConstraint -> Quantity[1, "Seconds"]];

In[2]:= TestEvaluate[test]["ActualOutput"]

Out[2]=
Failure["TimeConstrained", Association["MessageTemplate" :> TestEvaluate::cnsexd, 
  "MessageParameters" -> Association["Function" :> TimeConstrained, 
    "Constraint" :> HoldForm[Quantity[1, "Seconds"]]]]]
```

#### MetaInformation (2)

Store arbitrary metainformation in the ``TestObject`` :

```wl
In[1]:=
test = TestCreate[
	1, 
	2 + 2, 
	MetaInformation -> <|"$MachineID" -> $MachineID|>
	]

Out[1]=
TestObject[Association["Outcome" -> "NotEvaluated", "FailureType" -> None, "Input" -> HoldForm[1], 
  "ExpectedOutput" -> HoldForm[4], "ExpectedMessages" -> HoldForm[{}], 
  "MetaInformation" -> Association["$MachineID" -> "5106-30483-87605"], 
  " ... 88*^9, "SameTest" -> SameQ, 
  "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "49fbfe24-6dbb-40be-b675-13736eeecf79", 
  "TestID" -> "0hr60ph9xlfvd", "TestFileName" -> ""]]
```

Access the stored ``MetaInformation`` :

```wl
In[2]:= test["MetaInformation"]

Out[2]= <|"$MachineID" -> "5106-30483-87605"|>
```

---

``MetaInformation`` can be any expression:

```wl
In[1]:= test = TestCreate[2 + 2, 4, MetaInformation -> {$MachineID, $KernelID}]

Out[1]=
TestObject[Association["Outcome" -> "NotEvaluated", "FailureType" -> None, 
  "Input" -> HoldForm[2 + 2], "ExpectedOutput" -> HoldForm[4], "ExpectedMessages" -> HoldForm[{}], 
  "MetaInformation" -> {"5106-30483-87605", 0}, "AbsoluteTime" -> 3.907146009511105*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "d7159b8e-6e8e-4dbe-8cae-8eb526f5d0a0", 
  "TestID" -> "05p1kgqz8ztw7", "TestFileName" -> ""]]

In[2]:= test["MetaInformation"]

Out[2]= {"5106-30483-87605", 0}
```

### Possible Issues (3)

The expected output is evaluated before comparison with the actual output:

```wl
In[1]:= test = TestCreate[RandomReal[], RandomReal[]];

In[2]:= TestEvaluate[test]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.90714600962387*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "7dc31db0-dcb ... 973218], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000075`2.0255762612236943, "CPUTimeUsed" -> 0.00006999999999912632, 
  "MemoryUsed" -> 3408, "IntermediateTestsTree" -> {}, "Outcome" -> "Failure", 
  "FailureType" -> "SameTestFailure"]]
```

Use ``Unevaluated`` to compare expressions before evaluation happens:

```wl
In[3]:= test = TestCreate[Unevaluated[RandomReal[]], Unevaluated[RandomReal[]]];

In[4]:= TestEvaluate[test]

Out[4]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146009671125*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "67e83197-ca ... luated[RandomReal[]]], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000071`2.001773346551067, "CPUTimeUsed" -> 0.00006699999999959516, 
  "MemoryUsed" -> 3400, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

Messages generated on evaluation of expected output are not accounted for in the expected messages:

```wl
In[1]:= TestEvaluate[TestCreate[ComplexInfinity, 1 / 0]]
```

Power::infy: Infinite expression 1/0 encountered.

```wl
Out[1]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146009751967*^9, 
  "SameTest" -> SameQ, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "6526020b-8a ... Form[ComplexInfinity], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000063`1.9498555472855732, "CPUTimeUsed" -> 0.0000630000000008124, 
  "MemoryUsed" -> 3400, "IntermediateTestsTree" -> {}, "Outcome" -> "Success", 
  "FailureType" -> None]]
```

---

If ``SameTest`` does not evaluate to ``True`` or ``False``, a failure type of ``"SameTestUnevaluated"`` is reported:

```wl
In[1]:= Equal[x, y]

Out[1]= x == y

In[2]:= TestEvaluate[TestCreate[x, y, SameTest -> Equal]]

Out[2]=
TestObject[Association["MetaInformation" -> None, "AbsoluteTime" -> 3.907146009970341*^9, 
  "SameTest" -> Equal, "SameMessages" -> Testing`MessageMatchQ, "MemoryConstraint" -> Infinity, 
  "TimeConstraint" -> Infinity, "CreationID" -> "1d0cd0e2-06 ... rm[x], "ActualMessages" -> {}, 
  "AbsoluteTimeUsed" -> 0.000102`2.159115169593909, "CPUTimeUsed" -> 0.0001270000000008764, 
  "MemoryUsed" -> 3464, "IntermediateTestsTree" -> {}, "Outcome" -> "Failure", 
  "FailureType" -> "SameTestUnevaluated"]]
```

## See Also

* [`TestReport`](https://reference.wolfram.com/language/ref/TestReport.en.md)
* [`TestObject`](https://reference.wolfram.com/language/ref/TestObject.en.md)
* [`TestEvaluate`](https://reference.wolfram.com/language/ref/TestEvaluate.en.md)
* [`IntermediateTest`](https://reference.wolfram.com/language/ref/IntermediateTest.en.md)

## Tech Notes

* [Using Testing Notebooks](https://reference.wolfram.com/language/tutorial/UsingTestingNotebooks.en.md)
* [Using the Testing Framework](https://reference.wolfram.com/language/tutorial/UsingTheTestingFramework.en.md)

## Related Guides

* [Systematic Testing & Verification](https://reference.wolfram.com/language/guide/SystematicTestingAndVerification.en.md)
* [Tuning & Debugging](https://reference.wolfram.com/language/guide/TuningAndDebugging.en.md)

## Related Workflows

* [Write Unit Tests](https://reference.wolfram.com/language/workflow/WriteUnitTests.en.md)

## Related Links

* [An Elementary Introduction to the Wolfram Language: Debugging Your Code](https://www.wolfram.com/language/elementary-introduction/48-debugging-your-code.html)

## History

* [Introduced in 2023 (13.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn133.en.md)