add loc helper
Add tests for #1866 - loc helper
Merge pull request #1866 from tchak/loc

add loc helper