Add tests for case scoping