Mercurial > vim
comparison src/evalfunc.c @ 12337:040a892d0eed v8.0.1048
patch 8.0.1048: no test for what 8.0.1020 fixes
commit https://github.com/vim/vim/commit/5e80de3f3e572805fe734b66bc42c13303ad9bdb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 3 15:48:12 2017 +0200
patch 8.0.1048: no test for what 8.0.1020 fixes
Problem: No test for what 8.0.1020 fixes.
Solution: Add test_feedinput(). Add a test. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/2046)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 03 Sep 2017 16:00:05 +0200 |
parents | c7e95667d14b |
children | 61a9642297cc |
comparison
equal
deleted
inserted
replaced
12336:3914c0edd581 | 12337:040a892d0eed |
---|---|
391 static void f_taglist(typval_T *argvars, typval_T *rettv); | 391 static void f_taglist(typval_T *argvars, typval_T *rettv); |
392 static void f_tagfiles(typval_T *argvars, typval_T *rettv); | 392 static void f_tagfiles(typval_T *argvars, typval_T *rettv); |
393 static void f_tempname(typval_T *argvars, typval_T *rettv); | 393 static void f_tempname(typval_T *argvars, typval_T *rettv); |
394 static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv); | 394 static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv); |
395 static void f_test_autochdir(typval_T *argvars, typval_T *rettv); | 395 static void f_test_autochdir(typval_T *argvars, typval_T *rettv); |
396 static void f_test_feedinput(typval_T *argvars, typval_T *rettv); | |
396 static void f_test_override(typval_T *argvars, typval_T *rettv); | 397 static void f_test_override(typval_T *argvars, typval_T *rettv); |
397 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv); | 398 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv); |
398 static void f_test_ignore_error(typval_T *argvars, typval_T *rettv); | 399 static void f_test_ignore_error(typval_T *argvars, typval_T *rettv); |
399 #ifdef FEAT_JOB_CHANNEL | 400 #ifdef FEAT_JOB_CHANNEL |
400 static void f_test_null_channel(typval_T *argvars, typval_T *rettv); | 401 static void f_test_null_channel(typval_T *argvars, typval_T *rettv); |
849 {"term_start", 1, 2, f_term_start}, | 850 {"term_start", 1, 2, f_term_start}, |
850 {"term_wait", 1, 2, f_term_wait}, | 851 {"term_wait", 1, 2, f_term_wait}, |
851 #endif | 852 #endif |
852 {"test_alloc_fail", 3, 3, f_test_alloc_fail}, | 853 {"test_alloc_fail", 3, 3, f_test_alloc_fail}, |
853 {"test_autochdir", 0, 0, f_test_autochdir}, | 854 {"test_autochdir", 0, 0, f_test_autochdir}, |
855 {"test_feedinput", 1, 1, f_test_feedinput}, | |
854 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, | 856 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, |
855 {"test_ignore_error", 1, 1, f_test_ignore_error}, | 857 {"test_ignore_error", 1, 1, f_test_ignore_error}, |
856 #ifdef FEAT_JOB_CHANNEL | 858 #ifdef FEAT_JOB_CHANNEL |
857 {"test_null_channel", 0, 0, f_test_null_channel}, | 859 {"test_null_channel", 0, 0, f_test_null_channel}, |
858 #endif | 860 #endif |
12516 test_autochdir = TRUE; | 12518 test_autochdir = TRUE; |
12517 #endif | 12519 #endif |
12518 } | 12520 } |
12519 | 12521 |
12520 /* | 12522 /* |
12523 * "test_feedinput()" | |
12524 */ | |
12525 static void | |
12526 f_test_feedinput(typval_T *argvars, typval_T *rettv UNUSED) | |
12527 { | |
12528 #ifdef USE_INPUT_BUF | |
12529 char_u *val = get_tv_string_chk(&argvars[0]); | |
12530 | |
12531 if (val != NULL) | |
12532 { | |
12533 trash_input_buf(); | |
12534 add_to_input_buf_csi(val, (int)STRLEN(val)); | |
12535 } | |
12536 #endif | |
12537 } | |
12538 | |
12539 /* | |
12521 * "test_disable({name}, {val})" function | 12540 * "test_disable({name}, {val})" function |
12522 */ | 12541 */ |
12523 static void | 12542 static void |
12524 f_test_override(typval_T *argvars, typval_T *rettv UNUSED) | 12543 f_test_override(typval_T *argvars, typval_T *rettv UNUSED) |
12525 { | 12544 { |