TestService:Done() Doesn't work

TestService:Done() no longer functions.

A friend of mine was writing some unit tests when he found that TestService:Done() does not output anything to console. Pretty minor bug, but a bit annoying. hesholdingaknifetomyneckpleasehelp

4 Likes

Wait, people actually use the TestService?

13 Likes

Yeah.

I documented the macro functionality, so ya people can use it.

The service is used by Roblox to run controlled tests on various features in the engine, and they control it through scripts. Its how they make sure stuff doesn’t break unintentionally when they ship an update.

I’ve never even heard of roblox having any macros at all. Are the macros just global functions?
RBX_CHECK_NO_THROW(CODE)
pcall(function () CODE end) == true
A bit weird with RBX_CHECK_NO_THROW having ‘CODE’ and not ‘FUNC’

It is weird, but it works.

You can do something like:

RBX_CHECK_THROW(local var = Vectorr3.new()) 

This works because it wraps the contents between the parenthesis into a pcall, and uses the success status of the pcall as the condition parameter in a call to the Check method. Thats why the method has a source parameter and a line parameter. It automatically substitutes those variables for you. Roblox’s error checker will complain, but the code will still run correctly if you do a call to the Run method.

So to reiterate, the RBX_CHECK_THROW call example from above gets replaced with something like this:

game:GetService("TestService"):Check(pcall(function () local var = Vectorr3.new() end) == false, "Exception expected in " .. [==[local var = Vectorr3.new()]==])
2 Likes