Tests

Test Conditions, Test Sets (TDESC name: TunableTestSet) and Global Tests (TDESC name: TunableGlobalTestSet) are tuning resources that prohibit an action unless certain requirements are met. They can also be used for Autonomy Tests, which prohibit a Sim from doing an action autonomously if they meet certain conditions, though the player can still do them if they choose. At times, they can be small tuning fragments called snippets that can be referenced by tuning files. Often, they're simply coded into a tuning file directly.

Coding
There are significant differences between Test Sets and Global Tests. For example, a Global Test requires all tests listed inside to pass. These are commonly used to restrict interactions to specific ages. However, Test Sets can include different sets of tests than can be set as "AND" or "OR" operations depending on the tuning structure. Global Tests and Test Sets can be combined, however.

It is also possible to create custom test sets through a script, which enables the modder to define and use their own test syntax. This is expanded on in this Sims 4 Studio post by Frankk.

Section is incomplete and requires further expansion.

Example of a Global Test:
In this example, the Global Test denotes that the Actor—the Sim performing the action—must at least be an adult and the Actor and TargetSim—the Sim the action is being performed on—must have met before. If the game passes the test, then the action will be available. If it does not, it will not be available; the test will fail.

Examples of Test Sets:
This Test Set lists the same test as the example above, however, it is wrapped inside  tag. Everything inside an  tag is read by the game as an "AND" operation. That means both test needs to pass for the test to be successful. This Test Set has been written in a slightly different way. In this example, each Test is written inside its own  tag. It is read by the game as an "OR" operation. This means the Actor needs to be at least an adult or the Actor and TargetSim need to have met before.