Skip to content

Update testing.{txt,jax} #1577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 67 additions & 10 deletions doc/testing.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*testing.txt* For Vim バージョン 9.1. Last change: 2024 May 05
*testing.txt* For Vim バージョン 9.1. Last change: 2024 Jun 06


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -45,12 +45,16 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*

|method| としても使用できる: >
GetAllocId()->test_alloc_fail()
<
戻り値の型: |Number|


test_autochdir() *test_autochdir()*
Vimの起動が完了する前に 'autochdir' の効果を有効にするためのフ
ラグをセットする。

戻り値の型: |Number|


test_feedinput({string}) *test_feedinput()*
{string} の文字を、あたかもユーザーがタイプしたかのように処理
Expand All @@ -59,6 +63,8 @@ test_feedinput({string}) *test_feedinput()*

|method| としても使用できる: >
GetText()->test_feedinput()
<
戻り値の型: |Number|


test_garbagecollect_now() *test_garbagecollect_now()*
Expand All @@ -69,10 +75,13 @@ test_garbagecollect_now() *test_garbagecollect_now()*
これは、スタック上の変数が解放されるため、:def 関数から呼び出
された場合には動作しない。

戻り値の型: |Number|

test_garbagecollect_soon() *test_garbagecollect_soon()*
あたかもメインループの中にいるように、ガーベッジコレクトを呼び
出すためのフラグを設定する。テストでのみ使用される。

戻り値の型: |Number|

test_getvalue({name}) *test_getvalue()*
内部変数の値を取得する。{name} のこれらの値がサポートされてい
Expand All @@ -82,6 +91,8 @@ test_getvalue({name}) *test_getvalue()*
|method| としても使用できる: >
GetName()->test_getvalue()
<
戻り値の型: |Number|

*test_gui_event()*
test_gui_event({event}, {args})
機能テストしているVimで GUI のイベント {event} を引数 {args}
Expand Down Expand Up @@ -207,8 +218,9 @@ test_gui_event({event}, {args})

|method| としても使用できる: >
GetEvent()->test_gui_event({args})

<
戻り値の型: |vim9-boolean|

test_ignore_error({expr}) *test_ignore_error()*
{expr} を含むすべてのエラーを無視する。代わりに通常メッセージ
が表示される。
Expand All @@ -221,7 +233,8 @@ test_ignore_error({expr}) *test_ignore_error()*

|method| としても使用できる: >
GetErrorText()->test_ignore_error()

<
戻り値の型: |Number|

test_mswin_event({event}, {args}) *test_mswin_event()*
Vim の機能をテストするために、引数 {args} で低レベルの
Expand Down Expand Up @@ -310,40 +323,49 @@ test_mswin_event({event}, {args}) *test_mswin_event()*
|method| としても使用できる: >
GetEvent()->test_mswin_event({args})
<
戻り値の型: |vim9-boolean|

test_null_blob() *test_null_blob()*
null の |Blob| を返す。これはテストのみに使われる。

戻り値の型: |Blob|

test_null_channel() *test_null_channel()*
null の |Channel| を返す。これはテストのみに使われる。
{|+channel| 機能つきでコンパイルされたときのみ有効}

戻り値の型: |Channel|

test_null_dict() *test_null_dict()*
null の |Dict| を返す。これはテストのみに使われる。

戻り値の型: dict<any>

test_null_function() *test_null_function()*
null の |Funcref| を返す。これはテストのみに使われる。

戻り値の型: func(...): unknown

test_null_job() *test_null_job()*
null の |Job| を返す。これはテストのみに使われる。
{|+job| 機能つきでコンパイルされたときのみ有効}

戻り値の型: |job|

test_null_list() *test_null_list()*
null の |List| を返す。これはテストのみに使われる。

戻り値の型: list<any>

test_null_partial() *test_null_partial()*
null の |Partial| を返す。これはテストのみに使われる。

戻り値の型: func(...): unknown

test_null_string() *test_null_string()*
null の |String| を返す。これはテストのみに使われる。

戻り値の型: |String|

test_option_not_set({name}) *test_option_not_set()*
オプション {name} が設定されたことを示すフラグをリセットする。
Expand All @@ -357,7 +379,8 @@ test_option_not_set({name}) *test_option_not_set()*

|method| としても使用できる: >
GetOptionName()->test_option_not_set()

<
戻り値の型: |Number|

test_override({name}, {val}) *test_override()*
テストを実行できるようにするため、Vimの内部処理の特定の部分を
Expand Down Expand Up @@ -413,22 +436,26 @@ test_override({name}, {val}) *test_override()*

< |method| としても使用できる: >
GetOverrideVal()-> test_override('starting')

<
戻り値の型: |Number|

test_refcount({expr}) *test_refcount()*
{expr} の参照カウントを返す。{expr} が参照カウントを持たない型
の場合は、-1 を返す。この関数はテスト用。

|method| としても使用できる: >
GetVarname()->test_refcount()

<
戻り値の型: |Number|

test_setmouse({row}, {col}) *test_setmouse()*
次のマウス操作に使用するマウス位置を設定する。
{row} と {col} は 1ベースである。
例: >
call test_setmouse(4, 20)
call feedkeys("\<LeftMouse>", "xt")
<
戻り値の型: |Number|


test_settime({expr}) *test_settime()*
Expand All @@ -441,20 +468,25 @@ test_settime({expr}) *test_settime()*

|method| としても使用できる: >
GetTime()->test_settime()

<
戻り値の型: |Number|

test_srand_seed([{seed}]) *test_srand_seed()*
{seed} が渡されたときは `srand()` で使われる種の値を設定する。
省略されたときはテスト用の種を削除する。

戻り値の型: |Number|

test_unknown() *test_unknown()*
unknown型の値を返す。これはテストのみに使われる。

戻り値の型: unknown

test_void() *test_void()*
void型の値を返す。これはテストのみに使われる。

戻り値の型: unknown

==============================================================================
3. Assert関数 *assert-functions-details*

Expand All @@ -467,6 +499,8 @@ assert_beeps({cmd}) *assert_beeps()*
|method| としても使用できる: >
GetCmd()->assert_beeps()
<
戻り値の型: |Number|

*assert_equal()*
assert_equal({expected}, {actual} [, {msg}])
{expected}と{actual}が等しくない場合、|v:errors|にエラーメッセ
Expand All @@ -485,8 +519,10 @@ assert_equal({expected}, {actual} [, {msg}])

|method| としても使用でき、ベースは第2引数として渡される: >
mylist->assert_equal([1, 2, 3])
<
戻り値の型: |Number|

< *assert_equalfile()*
*assert_equalfile()*
assert_equalfile({fname-one}, {fname-two} [, {msg}])
ファイル {fname-one} および {fname-two} がまったく同じテキスト
でない場合、|v:errors| にエラーメッセージが追加される。
Expand All @@ -497,6 +533,8 @@ assert_equalfile({fname-one}, {fname-two} [, {msg}])

|method| としても使用できる: >
GetLog()->assert_equalfile('expected.log')
<
戻り値の型: |Number|

assert_exception({error} [, {msg}]) *assert_exception()*
v:exception に{error}が含まれていない時、|v:errors|にエラーメッ
Expand All @@ -510,6 +548,8 @@ assert_exception({error} [, {msg}]) *assert_exception()*
call assert_exception('E492:')
endtry
<
戻り値の型: |Number|

*assert_fails()*
assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
{cmd}を実行しエラーを生成しなかった場合か、エラーメッセージの
Expand Down Expand Up @@ -550,6 +590,8 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])

|method| としても使用できる: >
GetCmd()->assert_fails('E99:')
<
戻り値の型: |Number|

assert_false({actual} [, {msg}]) *assert_false()*
|assert_equal()|と同様に、{actual}がfalseでない場合、|v:errors|
Expand All @@ -563,6 +605,8 @@ assert_false({actual} [, {msg}]) *assert_false()*

|method| としても使用できる: >
GetResult()->assert_false()
<
戻り値の型: |Number|

assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
これは数値または |Float| の値をテストする。{actual}が{lower}よ
Expand All @@ -571,6 +615,8 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
エラーは "Expected range {lower} - {upper}, but got {actual}"
という形式である。{msg} が存在する場合は、その前に置かれる。

戻り値の型: |Number|

*assert_match()*
assert_match({pattern}, {actual} [, {msg}])
{pattern}が{actual}と一致しない場合、|v:errors|にエラーメッセー
Expand All @@ -595,6 +641,8 @@ assert_match({pattern}, {actual} [, {msg}])
|method| としても使用できる: >
getFile()->assert_match('foo.*')
<
戻り値の型: |Number|

assert_nobeep({cmd}) *assert_nobeep()*
{cmd} を実行し、それがビープもしくはビジュアルベルを発生させた
場合、|v:errors| にエラーメッセージを追加する。
Expand All @@ -603,6 +651,8 @@ assert_nobeep({cmd}) *assert_nobeep()*
|method| としても使用できる: >
GetCmd()->assert_nobeep()
<
戻り値の型: |Number|

*assert_notequal()*
assert_notequal({expected}, {actual} [, {msg}])
`assert_equal()` の反対: {expected}と{actual}が等しいときにエ
Expand All @@ -611,23 +661,28 @@ assert_notequal({expected}, {actual} [, {msg}])

|method| としても使用できる: >
mylist->assert_notequal([1, 2, 3])
<
戻り値の型: |Number|

< *assert_notmatch()*
*assert_notmatch()*
assert_notmatch({pattern}, {actual} [, {msg}])
`assert_match()` の反対: {pattern}が{actual}にマッチするときに
|v:errors| にエラーメッセージを追加する。
|assert-return| も参照。

|method| としても使用できる: >
getFile()->assert_notmatch('bar.*')

<
戻り値の型: |Number|

assert_report({msg}) *assert_report()*
テストの失敗を文字列 {msg} を使って直接報告する。
常に 1 を返す。

|method| としても使用できる: >
GetMessage()->assert_report()
<
戻り値の型: |Number|


assert_true({actual} [, {msg}]) *assert_true()*
Expand All @@ -641,5 +696,7 @@ assert_true({actual} [, {msg}]) *assert_true()*
|method| としても使用できる: >
GetResult()->assert_true()
<
戻り値の型: |Number|


vim:tw=78:ts=8:noet:ft=help:norl:
Loading