patch 8.0.1807: function to set terminal name is too long

Problem:    Function to set terminal name is too long.
Solution:   Refactor the function.  Fix typo in test.
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 0f2908f..8fa5f8b 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -284,7 +284,7 @@
     " in travis on some builds. Why?  Catch both for now
     try
       set ttytype=
-      call assert_report('set ttype= did not fail')
+      call assert_report('set ttytype= did not fail')
     catch /E529\|E522/
     endtry
 
@@ -292,7 +292,7 @@
     " check for failure of finding the entry and for missing 'cm' entry.
     try
       set ttytype=xxx
-      call assert_report('set ttype=xxx did not fail')
+      call assert_report('set ttytype=xxx did not fail')
     catch /E522\|E437/
     endtry