1
- *testing.txt* For Vim バージョン 9.1. Last change: 2024 May 05
1
+ *testing.txt* For Vim バージョン 9.1. Last change: 2024 Jun 06
2
2
3
3
4
4
VIMリファレンスマニュアル by Bram Moolenaar
@@ -45,12 +45,16 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
45
45
46
46
| method | としても使用できる: >
47
47
GetAllocId()->test_alloc_fail()
48
+ <
49
+ 戻り値の型: | Number |
48
50
49
51
50
52
test_autochdir() *test_autochdir()*
51
53
Vimの起動が完了する前に 'autochdir' の効果を有効にするためのフ
52
54
ラグをセットする。
53
55
56
+ 戻り値の型: | Number |
57
+
54
58
55
59
test_feedinput({string} ) *test_feedinput()*
56
60
{string} の文字を、あたかもユーザーがタイプしたかのように処理
@@ -59,6 +63,8 @@ test_feedinput({string}) *test_feedinput()*
59
63
60
64
| method | としても使用できる: >
61
65
GetText()->test_feedinput()
66
+ <
67
+ 戻り値の型: | Number |
62
68
63
69
64
70
test_garbagecollect_now() *test_garbagecollect_now()*
@@ -69,10 +75,13 @@ test_garbagecollect_now() *test_garbagecollect_now()*
69
75
これは、スタック上の変数が解放されるため、:def 関数から呼び出
70
76
された場合には動作しない。
71
77
78
+ 戻り値の型: | Number |
79
+
72
80
test_garbagecollect_soon() *test_garbagecollect_soon()*
73
81
あたかもメインループの中にいるように、ガーベッジコレクトを呼び
74
82
出すためのフラグを設定する。テストでのみ使用される。
75
83
84
+ 戻り値の型: | Number |
76
85
77
86
test_getvalue({name} ) *test_getvalue()*
78
87
内部変数の値を取得する。{name} のこれらの値がサポートされてい
@@ -82,6 +91,8 @@ test_getvalue({name}) *test_getvalue()*
82
91
| method | としても使用できる: >
83
92
GetName()->test_getvalue()
84
93
<
94
+ 戻り値の型: | Number |
95
+
85
96
*test_gui_event()*
86
97
test_gui_event({event} , {args} )
87
98
機能テストしているVimで GUI のイベント {event} を引数 {args}
@@ -207,8 +218,9 @@ test_gui_event({event}, {args})
207
218
208
219
| method | としても使用できる: >
209
220
GetEvent()->test_gui_event({args})
210
-
211
221
<
222
+ 戻り値の型: | vim9-boolean |
223
+
212
224
test_ignore_error({expr} ) *test_ignore_error()*
213
225
{expr} を含むすべてのエラーを無視する。代わりに通常メッセージ
214
226
が表示される。
@@ -221,7 +233,8 @@ test_ignore_error({expr}) *test_ignore_error()*
221
233
222
234
| method | としても使用できる: >
223
235
GetErrorText()->test_ignore_error()
224
-
236
+ <
237
+ 戻り値の型: | Number |
225
238
226
239
test_mswin_event({event} , {args} ) *test_mswin_event()*
227
240
Vim の機能をテストするために、引数 {args} で低レベルの
@@ -310,40 +323,49 @@ test_mswin_event({event}, {args}) *test_mswin_event()*
310
323
| method | としても使用できる: >
311
324
GetEvent()->test_mswin_event({args})
312
325
<
326
+ 戻り値の型: | vim9-boolean |
313
327
314
328
test_null_blob() *test_null_blob()*
315
329
null の | Blob | を返す。これはテストのみに使われる。
316
330
331
+ 戻り値の型: | Blob |
317
332
318
333
test_null_channel() *test_null_channel()*
319
334
null の | Channel | を返す。これはテストのみに使われる。
320
335
{| +channel | 機能つきでコンパイルされたときのみ有効}
321
336
337
+ 戻り値の型: | Channel |
322
338
323
339
test_null_dict() *test_null_dict()*
324
340
null の | Dict | を返す。これはテストのみに使われる。
325
341
342
+ 戻り値の型: dict<any>
326
343
327
344
test_null_function() *test_null_function()*
328
345
null の | Funcref | を返す。これはテストのみに使われる。
329
346
347
+ 戻り値の型: func(...): unknown
330
348
331
349
test_null_job() *test_null_job()*
332
350
null の | Job | を返す。これはテストのみに使われる。
333
351
{| +job | 機能つきでコンパイルされたときのみ有効}
334
352
353
+ 戻り値の型: | job |
335
354
336
355
test_null_list() *test_null_list()*
337
356
null の | List | を返す。これはテストのみに使われる。
338
357
358
+ 戻り値の型: list<any>
339
359
340
360
test_null_partial() *test_null_partial()*
341
361
null の | Partial | を返す。これはテストのみに使われる。
342
362
363
+ 戻り値の型: func(...): unknown
343
364
344
365
test_null_string() *test_null_string()*
345
366
null の | String | を返す。これはテストのみに使われる。
346
367
368
+ 戻り値の型: | String |
347
369
348
370
test_option_not_set({name} ) *test_option_not_set()*
349
371
オプション {name} が設定されたことを示すフラグをリセットする。
@@ -357,7 +379,8 @@ test_option_not_set({name}) *test_option_not_set()*
357
379
358
380
| method | としても使用できる: >
359
381
GetOptionName()->test_option_not_set()
360
-
382
+ <
383
+ 戻り値の型: | Number |
361
384
362
385
test_override({name} , {val} ) *test_override()*
363
386
テストを実行できるようにするため、Vimの内部処理の特定の部分を
@@ -413,22 +436,26 @@ test_override({name}, {val}) *test_override()*
413
436
414
437
< | method | としても使用できる: >
415
438
GetOverrideVal()-> test_override('starting')
416
-
439
+ <
440
+ 戻り値の型: | Number |
417
441
418
442
test_refcount({expr} ) *test_refcount()*
419
443
{expr} の参照カウントを返す。{expr} が参照カウントを持たない型
420
444
の場合は、-1 を返す。この関数はテスト用。
421
445
422
446
| method | としても使用できる: >
423
447
GetVarname()->test_refcount()
424
-
448
+ <
449
+ 戻り値の型: | Number |
425
450
426
451
test_setmouse({row} , {col} ) *test_setmouse()*
427
452
次のマウス操作に使用するマウス位置を設定する。
428
453
{row} と {col} は 1ベースである。
429
454
例: >
430
455
call test_setmouse(4, 20)
431
456
call feedkeys("\<LeftMouse>", "xt")
457
+ <
458
+ 戻り値の型: | Number |
432
459
433
460
434
461
test_settime({expr} ) *test_settime()*
@@ -441,20 +468,25 @@ test_settime({expr}) *test_settime()*
441
468
442
469
| method | としても使用できる: >
443
470
GetTime()->test_settime()
444
-
471
+ <
472
+ 戻り値の型: | Number |
445
473
446
474
test_srand_seed([{seed} ]) *test_srand_seed()*
447
475
{seed} が渡されたときは `srand ()` で使われる種の値を設定する。
448
476
省略されたときはテスト用の種を削除する。
449
477
478
+ 戻り値の型: | Number |
450
479
451
480
test_unknown() *test_unknown()*
452
481
unknown型の値を返す。これはテストのみに使われる。
453
482
483
+ 戻り値の型: unknown
454
484
455
485
test_void() *test_void()*
456
486
void型の値を返す。これはテストのみに使われる。
457
487
488
+ 戻り値の型: unknown
489
+
458
490
==============================================================================
459
491
3. Assert関数 *assert-functions-details*
460
492
@@ -467,6 +499,8 @@ assert_beeps({cmd}) *assert_beeps()*
467
499
| method | としても使用できる: >
468
500
GetCmd()->assert_beeps()
469
501
<
502
+ 戻り値の型: | Number |
503
+
470
504
*assert_equal()*
471
505
assert_equal({expected} , {actual} [, {msg} ])
472
506
{expected} と{actual} が等しくない場合、| v:errors | にエラーメッセ
@@ -485,8 +519,10 @@ assert_equal({expected}, {actual} [, {msg}])
485
519
486
520
| method | としても使用でき、ベースは第2引数として渡される: >
487
521
mylist->assert_equal([1, 2, 3])
522
+ <
523
+ 戻り値の型: | Number |
488
524
489
- < *assert_equalfile()*
525
+ *assert_equalfile()*
490
526
assert_equalfile({fname-one} , {fname-two} [, {msg} ])
491
527
ファイル {fname-one} および {fname-two} がまったく同じテキスト
492
528
でない場合、| v:errors | にエラーメッセージが追加される。
@@ -497,6 +533,8 @@ assert_equalfile({fname-one}, {fname-two} [, {msg}])
497
533
498
534
| method | としても使用できる: >
499
535
GetLog()->assert_equalfile('expected.log')
536
+ <
537
+ 戻り値の型: | Number |
500
538
501
539
assert_exception({error} [, {msg} ]) *assert_exception()*
502
540
v:exception に{error} が含まれていない時、| v:errors | にエラーメッ
@@ -510,6 +548,8 @@ assert_exception({error} [, {msg}]) *assert_exception()*
510
548
call assert_exception('E492:')
511
549
endtry
512
550
<
551
+ 戻り値の型: | Number |
552
+
513
553
*assert_fails()*
514
554
assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context} ]]]])
515
555
{cmd} を実行しエラーを生成しなかった場合か、エラーメッセージの
@@ -550,6 +590,8 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
550
590
551
591
| method | としても使用できる: >
552
592
GetCmd()->assert_fails('E99:')
593
+ <
594
+ 戻り値の型: | Number |
553
595
554
596
assert_false({actual} [, {msg} ]) *assert_false()*
555
597
| assert_equal() | と同様に、{actual} がfalseでない場合、| v:errors |
@@ -563,6 +605,8 @@ assert_false({actual} [, {msg}]) *assert_false()*
563
605
564
606
| method | としても使用できる: >
565
607
GetResult()->assert_false()
608
+ <
609
+ 戻り値の型: | Number |
566
610
567
611
assert_inrange({lower} , {upper} , {actual} [, {msg} ]) *assert_inrange()*
568
612
これは数値または | Float | の値をテストする。{actual} が{lower} よ
@@ -571,6 +615,8 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
571
615
エラーは "Expected range {lower} - {upper} , but got {actual} "
572
616
という形式である。{msg} が存在する場合は、その前に置かれる。
573
617
618
+ 戻り値の型: | Number |
619
+
574
620
*assert_match()*
575
621
assert_match({pattern} , {actual} [, {msg} ])
576
622
{pattern} が{actual} と一致しない場合、| v:errors | にエラーメッセー
@@ -595,6 +641,8 @@ assert_match({pattern}, {actual} [, {msg}])
595
641
| method | としても使用できる: >
596
642
getFile()->assert_match('foo.*')
597
643
<
644
+ 戻り値の型: | Number |
645
+
598
646
assert_nobeep({cmd} ) *assert_nobeep()*
599
647
{cmd} を実行し、それがビープもしくはビジュアルベルを発生させた
600
648
場合、| v:errors | にエラーメッセージを追加する。
@@ -603,6 +651,8 @@ assert_nobeep({cmd}) *assert_nobeep()*
603
651
| method | としても使用できる: >
604
652
GetCmd()->assert_nobeep()
605
653
<
654
+ 戻り値の型: | Number |
655
+
606
656
*assert_notequal()*
607
657
assert_notequal({expected} , {actual} [, {msg} ])
608
658
`assert_equal ()` の反対: {expected} と{actual} が等しいときにエ
@@ -611,23 +661,28 @@ assert_notequal({expected}, {actual} [, {msg}])
611
661
612
662
| method | としても使用できる: >
613
663
mylist->assert_notequal([1, 2, 3])
664
+ <
665
+ 戻り値の型: | Number |
614
666
615
- < *assert_notmatch()*
667
+ *assert_notmatch()*
616
668
assert_notmatch({pattern} , {actual} [, {msg} ])
617
669
`assert_match ()` の反対: {pattern} が{actual} にマッチするときに
618
670
| v:errors | にエラーメッセージを追加する。
619
671
| assert-return | も参照。
620
672
621
673
| method | としても使用できる: >
622
674
getFile()->assert_notmatch('bar.*')
623
-
675
+ <
676
+ 戻り値の型: | Number |
624
677
625
678
assert_report({msg} ) *assert_report()*
626
679
テストの失敗を文字列 {msg} を使って直接報告する。
627
680
常に 1 を返す。
628
681
629
682
| method | としても使用できる: >
630
683
GetMessage()->assert_report()
684
+ <
685
+ 戻り値の型: | Number |
631
686
632
687
633
688
assert_true({actual} [, {msg} ]) *assert_true()*
@@ -641,5 +696,7 @@ assert_true({actual} [, {msg}]) *assert_true()*
641
696
| method | としても使用できる: >
642
697
GetResult()->assert_true()
643
698
<
699
+ 戻り値の型: | Number |
700
+
644
701
645
702
vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments