Improve test case for ifvarclass with functions

As per feedback to ediosyncratic, make sure we test the positive
case as well, and use standard "ok" class to mark pass/fail.
(cherry picked from commit dcedd29b2aa3cda93264cc7497611526a263e8c7)