functional tests for template and expression