test that scoping works as expected