Unit test for scalar subqueries