Skip to content

Update {repeat,testing}.{txt.jax) #981

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 8 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
21 changes: 19 additions & 2 deletions doc/repeat.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*repeat.txt* For Vim バージョン 8.2. Last change: 2021 Jun 11
*repeat.txt* For Vim バージョン 8.2. Last change: 2021 Nov 24


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -781,6 +781,10 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作

デバッグモードのためのコマンドラインヒストリが別に用意されている。

NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて次行へ続くとき、旧
来のバックスラッシュを使わずに行継続するため、最初の行のみデバッグ出力に表示さ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「...次行へ続いて、...バックスラッシュを使わずに行継続しているとき」のような気がしました。

れる。

関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する
場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、
"99j" を実行すること。"99" は実際の行番号に合わせて変えること。
Expand Down Expand Up @@ -831,6 +835,15 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作
(どうすべきかがわかりにくいため)。
- 同じ名前のExコマンドを使うにはコロンを付けること:
":cont", ":next", ":finish" (省略時も)
*vim9-debug*
コンパイル済みの :def 関数をデバッグする場合、"step" はすべての命令ではなく、
実行されるすべての行の前で停止する。これにより、ほとんどの場合は非コンパイル関
数のように動作する。ローカル変数へのアクセスは制限されているが可能である: >
echo varname
しかし他にはあまりない。
特定のバイトコード命令ではなく、通常のExコマンドのように実行されるコマンドを実
行する場合、"step" はローカル変数を検査できるコンパイル済みコンテキストで1回、
そしてコマンドを実行する直前に1回停止する。

バックトレースは、関数呼び出しの階層を表示する。例えば:
>bt ~
Expand Down Expand Up @@ -871,8 +884,12 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作
{expression} の評価結果が異なる値となるときに常にブレークする
ブレークポイントを設定する。例: >
:breakadd expr g:lnum

< これはグローバル変数の lnum が変化するときに常にブレークする。

評価中のエラーは抑制されるので、まだ存在しない変数の名前が使え
る。これはまた、式に間違いがあっても何も気付けないということで
もある。

Note: |script-variable| を監視する場合、スクリプトが切り替わっ
たときにブレークする。これは、定義されたスクリプト内でのみ、そ
のスクリプト変数が有効だからである。そしてそのスクリプトがいく
Expand Down
36 changes: 22 additions & 14 deletions doc/testing.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*testing.txt* For Vim バージョン 8.2. Last change: 2021 Jul 07
*testing.txt* For Vim バージョン 8.2. Last change: 2021 Aug 15


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -46,6 +46,7 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
|method| としても使用できる: >
GetAllocId()->test_alloc_fail()


test_autochdir() *test_autochdir()*
Vimの起動が完了する前に 'autochdir' の効果を有効にするためのフ
ラグをセットする。
Expand All @@ -59,6 +60,7 @@ test_feedinput({string}) *test_feedinput()*
|method| としても使用できる: >
GetText()->test_feedinput()


test_garbagecollect_now() *test_garbagecollect_now()*
garbagecollect() とほぼ同じであるが、この関数はガーベッジコレ
クトを直ちに実行する。この関数を実行する場合は、構造体が内部に
Expand All @@ -82,15 +84,16 @@ test_getvalue({name}) *test_getvalue()*
*test_gui_drop_files()*
test_gui_drop_files({list}, {row}, {col}, {mods})
{list} の1つ以上のファイルをウィンドウの {row} 行 {col} 列にド
ロップする。この関数は |drag-n-drop| 機能が存在するGUI版のVim
でのみ動作する
ロップする。この関数は |drop_file| 機能が存在するGUI版のVim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空白の入れ方がVimの前後で異なっています。

のみ動作する

{mods} としてサポートされる値:
0x4 Shift
0x8 Alt
0x10 Ctrl
ファイルは引数リストに追加され、{list} の最初のファイルの編集
がウィンドウで開始される。詳細は |drag-n-drop| を参照。
ファイルは引数リスト |argument-list| に追加され、{list} の最初
のファイルの編集がウィンドウで開始される。詳細は |drag-n-drop|
を参照。

*test_gui_mouse_event()*
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
Expand Down Expand Up @@ -131,6 +134,7 @@ test_ignore_error({expr}) *test_ignore_error()*
|method| としても使用できる: >
GetErrorText()->test_ignore_error()


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

Expand Down Expand Up @@ -165,14 +169,6 @@ test_null_string() *test_null_string()*
null の |String| を返す。これはテストのみに使われる。


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


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


test_option_not_set({name}) *test_option_not_set()*
オプション {name} が設定されたことを示すフラグをリセットする。
したがって、それはまだデフォルト値を持っているように見える。次
Expand Down Expand Up @@ -224,6 +220,7 @@ test_override({name}, {val}) *test_override()*
< |method| としても使用できる: >
GetOverrideVal()-> test_override('starting')


test_refcount({expr}) *test_refcount()*
{expr} の参照カウントを返す。{expr} が参照カウントを持たない型
の場合は、-1 を返す。この関数はテスト用。
Expand Down Expand Up @@ -253,13 +250,15 @@ test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()*
|method| としても使用できる: >
GetValue()->test_scrollbar('right', 0)


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


test_settime({expr}) *test_settime()*
Vim が内部的に用いる時間を設定する。現在は history のタイムス
タンプ、viminfo のタイムスタンプ、undo に使用されている。
Expand All @@ -271,10 +270,19 @@ test_settime({expr}) *test_settime()*
|method| としても使用できる: >
GetTime()->test_settime()


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


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


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

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

Expand Down Expand Up @@ -440,7 +448,7 @@ assert_notmatch({pattern}, {actual} [, {msg}])


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

|method| としても使用できる: >
Expand Down
22 changes: 20 additions & 2 deletions en/repeat.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 11
*repeat.txt* For Vim version 8.2. Last change: 2021 Nov 24


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -792,6 +792,10 @@ won't be very helpful.

There is a separate command-line history for debug mode.

NOTE: In Vim9 script, if a command is written at the script level and
continues on the next line, not using the old way with a backslash for line
continuation, only the first line is printed before the debugging prompt.

The line number for a function line is relative to the start of the function.
If you have trouble figuring out where you are, edit the file that defines
the function in another Vim, search for the start of the function and do
Expand Down Expand Up @@ -844,6 +848,16 @@ About the additional commands in debug mode:
is reset (because it's not clear what you want to repeat).
- When you want to use the Ex command with the same name, prepend a colon:
":cont", ":next", ":finish" (or shorter).
*vim9-debug*
When debugging a compiled :def function, "step" will stop before every
executed line, not every single instruction. Thus it works mostly like a not
compiled function. Access to local variables is limited you can use: >
echo varname
But not much else.
When executing a command that is not a specific bytecode instruction but
executed like a normal Ex command, "step" will stop once in the compiled
context, where local variables can be inspected, and once just before
executing the command.

The backtrace shows the hierarchy of function calls, e.g.:
>bt ~
Expand Down Expand Up @@ -883,8 +897,12 @@ DEFINING BREAKPOINTS
Sets a breakpoint, that will break whenever the {expression}
evaluates to a different value. Example: >
:breakadd expr g:lnum

< Will break, whenever the global variable lnum changes.

Errors in evaluation are suppressed, you can use the name of a
variable that does not exist yet. This also means you will
not notice anything if the expression has a mistake.

Note if you watch a |script-variable| this will break
when switching scripts, since the script variable is only
valid in the script where it has been defined and if that
Expand Down
34 changes: 21 additions & 13 deletions en/testing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2021 Jul 07
*testing.txt* For Vim version 8.2. Last change: 2021 Aug 15


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -46,6 +46,7 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
Can also be used as a |method|: >
GetAllocId()->test_alloc_fail()


test_autochdir() *test_autochdir()*
Set a flag to enable the effect of 'autochdir' before Vim
startup has finished.
Expand All @@ -59,6 +60,7 @@ test_feedinput({string}) *test_feedinput()*
Can also be used as a |method|: >
GetText()->test_feedinput()


test_garbagecollect_now() *test_garbagecollect_now()*
Like garbagecollect(), but executed right away. This must
only be called directly to avoid any structure to exist
Expand All @@ -83,14 +85,14 @@ test_getvalue({name}) *test_getvalue()*
test_gui_drop_files({list}, {row}, {col}, {mods})
Drop one or more files in {list} in the window at {row}, {col}.
This function only works when the GUI is running and the
|drag-n-drop| feature is present.
|drop_file| feature is present.

The supported values for {mods} are:
0x4 Shift
0x8 Alt
0x10 Ctrl
The files are added to the argument list and the first file in
{list} is edited in the window. See |drag-n-drop| for more
The files are added to the |argument-list| and the first file
in {list} is edited in the window. See |drag-n-drop| for more
information.

*test_gui_mouse_event()*
Expand Down Expand Up @@ -132,6 +134,7 @@ test_ignore_error({expr}) *test_ignore_error()*
Can also be used as a |method|: >
GetErrorText()->test_ignore_error()


test_null_blob() *test_null_blob()*
Return a |Blob| that is null. Only useful for testing.

Expand Down Expand Up @@ -166,13 +169,6 @@ test_null_string() *test_null_string()*
Return a |String| that is null. Only useful for testing.


test_unknown() *test_unknown()*
Return a value with unknown type. Only useful for testing.

test_void() *test_void()*
Return a value with void type. Only useful for testing.


test_option_not_set({name}) *test_option_not_set()*
Reset the flag that indicates option {name} was set. Thus it
looks like it still has the default value. Use like this: >
Expand Down Expand Up @@ -224,6 +220,7 @@ test_override({name}, {val}) *test_override()*
< Can also be used as a |method|: >
GetOverrideVal()-> test_override('starting')


test_refcount({expr}) *test_refcount()*
Return the reference count of {expr}. When {expr} is of a
type that does not have a reference count, returns -1. Only
Expand Down Expand Up @@ -253,13 +250,15 @@ test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()*
Can also be used as a |method|: >
GetValue()->test_scrollbar('right', 0)


test_setmouse({row}, {col}) *test_setmouse()*
Set the mouse position to be used for the next mouse action.
{row} and {col} are one based.
For example: >
call test_setmouse(4, 20)
call feedkeys("\<LeftMouse>", "xt")


test_settime({expr}) *test_settime()*
Set the time Vim uses internally. Currently only used for
timestamps in the history, as they are used in viminfo, and
Expand All @@ -272,10 +271,19 @@ test_settime({expr}) *test_settime()*
Can also be used as a |method|: >
GetTime()->test_settime()


test_srand_seed([seed]) *test_srand_seed()*
When [seed] is given this sets the seed value used by
`srand()`. When omitted the test seed is removed.


test_unknown() *test_unknown()*
Return a value with unknown type. Only useful for testing.


test_void() *test_void()*
Return a value with void type. Only useful for testing.

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

Expand Down Expand Up @@ -446,7 +454,7 @@ assert_notmatch({pattern}, {actual} [, {msg}])


assert_report({msg}) *assert_report()*
Report a test failure directly, using {msg}.
Report a test failure directly, using String {msg}.
Always returns one.

Can also be used as a |method|: >
Expand Down