Fixes #7909
* fix: trim whitespace when importing variables * feat: added tests for importing variables