Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Write a formatted and readable unit test for any input
ResourceFunction["WriteUnitTest"][file,expr] evaluates expr and uses the result to write a VerificationTest in file. |
Create a unit test and write it to file:
| In[1]:= | ![]() |
Run the test:
| In[2]:= |
| Out[2]= |
Create a test for an input that issues a message:
| In[3]:= | ![]() |
| In[4]:= |

Run the test:
| In[5]:= |
| Out[5]= |
Use the option "ConfirmResults" to write the test to file without verifying the results:
| In[6]:= |
| In[7]:= |
| In[8]:= |
Each test was appended to the file:
| In[9]:= |
| Out[9]= |
This work is licensed under a Creative Commons Attribution 4.0 International License