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.
Merge pull request #1928 from vohi/master

Improve test case for ifvarclass with functions