patch 7.4.1300
Problem:    Cannot test CursorMovedI because there is typeahead.
Solution:   Add disable_char_avail_for_testing().
diff --git a/src/getchar.c b/src/getchar.c
index 2c57090..0347514 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1888,6 +1888,12 @@
 {
     int	    retval;
 
+#ifdef FEAT_EVAL
+    /* When disable_char_avail_for_testing(1) was called pretend there is no
+     * typeahead. */
+    if (disable_char_avail_for_testing)
+	return FALSE;
+#endif
     ++no_mapping;
     retval = vpeekc();
     --no_mapping;