unit test for guards, adding in closure scoped guarding