patch 8.2.0866: not enough tests for buffer writing

Problem:    Not enough tests for buffer writing.
Solution:   Add more tests. Use CheckRunVimInTerminal in more places.
            (Yegappan Lakshmanan, closes #6167)
diff --git a/src/testdir/test_startup_utf8.vim b/src/testdir/test_startup_utf8.vim
index 8f969d3..ffbc793 100644
--- a/src/testdir/test_startup_utf8.vim
+++ b/src/testdir/test_startup_utf8.vim
@@ -62,9 +62,7 @@
 endfunc
 
 func Test_detect_ambiwidth()
-  if !CanRunVimInTerminal()
-    throw 'Skipped: cannot run Vim in a terminal window'
-  endif
+  CheckRunVimInTerminal
 
   " Use the title termcap entries to output the escape sequence.
   call writefile([