Added code escape test.

Added failing unit test to cover Issue #1037 , Issue #1045