added a test to verify that STACK_EXIT works as expected

Added the test and ran it. It works as expected.