# This file contains a scenario for testing preedit text when a user uses
# 12-key toggle key layout on mobile.

# Enable IME
SEND_KEY	ON

SET_MOBILE_REQUEST
UPDATE_MOBILE_KEYBOARD	TWELVE_KEYS_TO_HIRAGANA	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_INPUT_MODE	HIRAGANA

# Simple toggling on A-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	1
EXPECT_PREEDIT	あ
SEND_KEYS	1
EXPECT_PREEDIT	い
SEND_KEYS	1
EXPECT_PREEDIT	う
SEND_KEYS	1
EXPECT_PREEDIT	え
SEND_KEYS	1
EXPECT_PREEDIT	お
SEND_KEYS	1
EXPECT_PREEDIT	ぁ
SEND_KEYS	1
EXPECT_PREEDIT	ぃ
SEND_KEYS	1
EXPECT_PREEDIT	ぅ
SEND_KEYS	1
EXPECT_PREEDIT	ぇ
SEND_KEYS	1
EXPECT_PREEDIT	ぉ
SEND_KEYS	1
EXPECT_PREEDIT	あ

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	ぉ
UNDO_OR_REWIND
EXPECT_PREEDIT	ぇ
UNDO_OR_REWIND
EXPECT_PREEDIT	ぅ
UNDO_OR_REWIND
EXPECT_PREEDIT	ぃ
UNDO_OR_REWIND
EXPECT_PREEDIT	ぁ
UNDO_OR_REWIND
EXPECT_PREEDIT	お
UNDO_OR_REWIND
EXPECT_PREEDIT	え
UNDO_OR_REWIND
EXPECT_PREEDIT	う
UNDO_OR_REWIND
EXPECT_PREEDIT	い
UNDO_OR_REWIND
EXPECT_PREEDIT	あ

# Make sure tapping '1' toggles the last character, not adding a new character.
SEND_KEYS	1
EXPECT_PREEDIT	い

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	1
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ああ

RESET_CONTEXT
SEND_KEYS	11
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	いあ

RESET_CONTEXT
SEND_KEYS	111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	うあ

RESET_CONTEXT
SEND_KEYS	1111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	えあ

RESET_CONTEXT
SEND_KEYS	11111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	おあ

RESET_CONTEXT
SEND_KEYS	111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぁあ

RESET_CONTEXT
SEND_KEYS	1111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぃあ

RESET_CONTEXT
SEND_KEYS	11111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぅあ

RESET_CONTEXT
SEND_KEYS	111111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぇあ

RESET_CONTEXT
SEND_KEYS	1111111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぉあ

# Test for A-row small characters
RESET_CONTEXT
SEND_KEYS	1
EXPECT_PREEDIT	あ
SEND_KEYS	*
EXPECT_PREEDIT	ぁ
SEND_KEYS	*
EXPECT_PREEDIT	あ
SEND_KEYS	*
EXPECT_PREEDIT	ぁ
SEND_KEYS	*
EXPECT_PREEDIT	あ
SEND_KEYS	1
EXPECT_PREEDIT	ああ

RESET_CONTEXT
SEND_KEYS	1*
EXPECT_PREEDIT	ぁ
SEND_KEYS	1
EXPECT_PREEDIT	ぁあ

RESET_CONTEXT
SEND_KEYS	11
EXPECT_PREEDIT	い
SEND_KEYS	*
EXPECT_PREEDIT	ぃ
SEND_KEYS	*
EXPECT_PREEDIT	い
SEND_KEYS	*
EXPECT_PREEDIT	ぃ
SEND_KEYS	*
EXPECT_PREEDIT	い
SEND_KEYS	1
EXPECT_PREEDIT	いあ

RESET_CONTEXT
SEND_KEYS	11*
EXPECT_PREEDIT	ぃ
SEND_KEYS	1
EXPECT_PREEDIT	ぃあ

RESET_CONTEXT
SEND_KEYS	111
EXPECT_PREEDIT	う
SEND_KEYS	*
EXPECT_PREEDIT	ぅ
SEND_KEYS	*
EXPECT_PREEDIT	ゔ
SEND_KEYS	*
EXPECT_PREEDIT	う
SEND_KEYS	*
EXPECT_PREEDIT	ぅ
SEND_KEYS	*
EXPECT_PREEDIT	ゔ
SEND_KEYS	*
EXPECT_PREEDIT	う
SEND_KEYS	1
EXPECT_PREEDIT	うあ

RESET_CONTEXT
SEND_KEYS	111*
EXPECT_PREEDIT	ぅ
SEND_KEYS	1
EXPECT_PREEDIT	ぅあ

RESET_CONTEXT
SEND_KEYS	111**
EXPECT_PREEDIT	ゔ
SEND_KEYS	1
EXPECT_PREEDIT	ゔあ

RESET_CONTEXT
SEND_KEYS	1111
EXPECT_PREEDIT	え
SEND_KEYS	*
EXPECT_PREEDIT	ぇ
SEND_KEYS	*
EXPECT_PREEDIT	え
SEND_KEYS	*
EXPECT_PREEDIT	ぇ
SEND_KEYS	*
EXPECT_PREEDIT	え
SEND_KEYS	1
EXPECT_PREEDIT	えあ

RESET_CONTEXT
SEND_KEYS	1111*
EXPECT_PREEDIT	ぇ
SEND_KEYS	1
EXPECT_PREEDIT	ぇあ

RESET_CONTEXT
SEND_KEYS	11111
EXPECT_PREEDIT	お
SEND_KEYS	*
EXPECT_PREEDIT	ぉ
SEND_KEYS	*
EXPECT_PREEDIT	お
SEND_KEYS	*
EXPECT_PREEDIT	ぉ
SEND_KEYS	*
EXPECT_PREEDIT	お
SEND_KEYS	1
EXPECT_PREEDIT	おあ

RESET_CONTEXT
SEND_KEYS	11111*
EXPECT_PREEDIT	ぉ
SEND_KEYS	1
EXPECT_PREEDIT	ぉあ

# Simple toggling on Ka-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	2
EXPECT_PREEDIT	か
SEND_KEYS	2
EXPECT_PREEDIT	き
SEND_KEYS	2
EXPECT_PREEDIT	く
SEND_KEYS	2
EXPECT_PREEDIT	け
SEND_KEYS	2
EXPECT_PREEDIT	こ
SEND_KEYS	2
EXPECT_PREEDIT	か

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	こ
UNDO_OR_REWIND
EXPECT_PREEDIT	け
UNDO_OR_REWIND
EXPECT_PREEDIT	く
UNDO_OR_REWIND
EXPECT_PREEDIT	き
UNDO_OR_REWIND
EXPECT_PREEDIT	か

# Make sure tapping '2' toggles the last character, not adding a new character.
SEND_KEYS	2
EXPECT_PREEDIT	き

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	2
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	かか

RESET_CONTEXT
SEND_KEYS	22
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	きか

RESET_CONTEXT
SEND_KEYS	222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	くか

RESET_CONTEXT
SEND_KEYS	2222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	けか

RESET_CONTEXT
SEND_KEYS	22222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	こか

# Test for Ka-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	2
EXPECT_PREEDIT	か
SEND_KEYS	*
EXPECT_PREEDIT	が
SEND_KEYS	*
EXPECT_PREEDIT	か
SEND_KEYS	*
EXPECT_PREEDIT	が
SEND_KEYS	*
EXPECT_PREEDIT	か
SEND_KEYS	2
EXPECT_PREEDIT	かか

RESET_CONTEXT
SEND_KEYS	2*
EXPECT_PREEDIT	が
SEND_KEYS	2
EXPECT_PREEDIT	がか

RESET_CONTEXT
SEND_KEYS	22
EXPECT_PREEDIT	き
SEND_KEYS	*
EXPECT_PREEDIT	ぎ
SEND_KEYS	*
EXPECT_PREEDIT	き
SEND_KEYS	*
EXPECT_PREEDIT	ぎ
SEND_KEYS	*
EXPECT_PREEDIT	き
SEND_KEYS	2
EXPECT_PREEDIT	きか

RESET_CONTEXT
SEND_KEYS	22*
EXPECT_PREEDIT	ぎ
SEND_KEYS	2
EXPECT_PREEDIT	ぎか

RESET_CONTEXT
SEND_KEYS	222
EXPECT_PREEDIT	く
SEND_KEYS	*
EXPECT_PREEDIT	ぐ
SEND_KEYS	*
EXPECT_PREEDIT	く
SEND_KEYS	*
EXPECT_PREEDIT	ぐ
SEND_KEYS	*
EXPECT_PREEDIT	く
SEND_KEYS	2
EXPECT_PREEDIT	くか

RESET_CONTEXT
SEND_KEYS	222*
EXPECT_PREEDIT	ぐ
SEND_KEYS	2
EXPECT_PREEDIT	ぐか

RESET_CONTEXT
SEND_KEYS	2222
EXPECT_PREEDIT	け
SEND_KEYS	*
EXPECT_PREEDIT	げ
SEND_KEYS	*
EXPECT_PREEDIT	け
SEND_KEYS	*
EXPECT_PREEDIT	げ
SEND_KEYS	*
EXPECT_PREEDIT	け
SEND_KEYS	2
EXPECT_PREEDIT	けか

RESET_CONTEXT
SEND_KEYS	2222*
EXPECT_PREEDIT	げ
SEND_KEYS	2
EXPECT_PREEDIT	げか

RESET_CONTEXT
SEND_KEYS	22222
EXPECT_PREEDIT	こ
SEND_KEYS	*
EXPECT_PREEDIT	ご
SEND_KEYS	*
EXPECT_PREEDIT	こ
SEND_KEYS	*
EXPECT_PREEDIT	ご
SEND_KEYS	*
EXPECT_PREEDIT	こ
SEND_KEYS	2
EXPECT_PREEDIT	こか

RESET_CONTEXT
SEND_KEYS	22222*
EXPECT_PREEDIT	ご
SEND_KEYS	2
EXPECT_PREEDIT	ごか

# Simple toggling on Sa-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	3
EXPECT_PREEDIT	さ
SEND_KEYS	3
EXPECT_PREEDIT	し
SEND_KEYS	3
EXPECT_PREEDIT	す
SEND_KEYS	3
EXPECT_PREEDIT	せ
SEND_KEYS	3
EXPECT_PREEDIT	そ
SEND_KEYS	3
EXPECT_PREEDIT	さ

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	そ
UNDO_OR_REWIND
EXPECT_PREEDIT	せ
UNDO_OR_REWIND
EXPECT_PREEDIT	す
UNDO_OR_REWIND
EXPECT_PREEDIT	し
UNDO_OR_REWIND
EXPECT_PREEDIT	さ

# Make sure tapping '3' toggles the last character, not adding a new character.
SEND_KEYS	3
EXPECT_PREEDIT	し

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	3
SEND_KEY	RIGHT
SEND_KEYS	3
EXPECT_PREEDIT	ささ

RESET_CONTEXT
SEND_KEYS	33
SEND_KEY	RIGHT
SEND_KEYS	3
EXPECT_PREEDIT	しさ

RESET_CONTEXT
SEND_KEYS	333
SEND_KEY	RIGHT
SEND_KEYS	3
EXPECT_PREEDIT	すさ

RESET_CONTEXT
SEND_KEYS	3333
SEND_KEY	RIGHT
SEND_KEYS	3
EXPECT_PREEDIT	せさ

RESET_CONTEXT
SEND_KEYS	33333
SEND_KEY	RIGHT
SEND_KEYS	3
EXPECT_PREEDIT	そさ

# Test for Sa-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	3
EXPECT_PREEDIT	さ
SEND_KEYS	*
EXPECT_PREEDIT	ざ
SEND_KEYS	*
EXPECT_PREEDIT	さ
SEND_KEYS	*
EXPECT_PREEDIT	ざ
SEND_KEYS	*
EXPECT_PREEDIT	さ
SEND_KEYS	3
EXPECT_PREEDIT	ささ

RESET_CONTEXT
SEND_KEYS	3*
EXPECT_PREEDIT	ざ
SEND_KEYS	3
EXPECT_PREEDIT	ざさ

RESET_CONTEXT
SEND_KEYS	33
EXPECT_PREEDIT	し
SEND_KEYS	*
EXPECT_PREEDIT	じ
SEND_KEYS	*
EXPECT_PREEDIT	し
SEND_KEYS	*
EXPECT_PREEDIT	じ
SEND_KEYS	*
EXPECT_PREEDIT	し
SEND_KEYS	3
EXPECT_PREEDIT	しさ

RESET_CONTEXT
SEND_KEYS	33*
EXPECT_PREEDIT	じ
SEND_KEYS	3
EXPECT_PREEDIT	じさ

RESET_CONTEXT
SEND_KEYS	333
EXPECT_PREEDIT	す
SEND_KEYS	*
EXPECT_PREEDIT	ず
SEND_KEYS	*
EXPECT_PREEDIT	す
SEND_KEYS	*
EXPECT_PREEDIT	ず
SEND_KEYS	*
EXPECT_PREEDIT	す
SEND_KEYS	3
EXPECT_PREEDIT	すさ

RESET_CONTEXT
SEND_KEYS	333*
EXPECT_PREEDIT	ず
SEND_KEYS	3
EXPECT_PREEDIT	ずさ

RESET_CONTEXT
SEND_KEYS	3333
EXPECT_PREEDIT	せ
SEND_KEYS	*
EXPECT_PREEDIT	ぜ
SEND_KEYS	*
EXPECT_PREEDIT	せ
SEND_KEYS	*
EXPECT_PREEDIT	ぜ
SEND_KEYS	*
EXPECT_PREEDIT	せ
SEND_KEYS	3
EXPECT_PREEDIT	せさ

RESET_CONTEXT
SEND_KEYS	3333*
EXPECT_PREEDIT	ぜ
SEND_KEYS	3
EXPECT_PREEDIT	ぜさ

RESET_CONTEXT
SEND_KEYS	33333
EXPECT_PREEDIT	そ
SEND_KEYS	*
EXPECT_PREEDIT	ぞ
SEND_KEYS	*
EXPECT_PREEDIT	そ
SEND_KEYS	*
EXPECT_PREEDIT	ぞ
SEND_KEYS	*
EXPECT_PREEDIT	そ
SEND_KEYS	3
EXPECT_PREEDIT	そさ

RESET_CONTEXT
SEND_KEYS	33333*
EXPECT_PREEDIT	ぞ
SEND_KEYS	3
EXPECT_PREEDIT	ぞさ

# Simple toggling on Ta-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	4
EXPECT_PREEDIT	た
SEND_KEYS	4
EXPECT_PREEDIT	ち
SEND_KEYS	4
EXPECT_PREEDIT	つ
SEND_KEYS	4
EXPECT_PREEDIT	て
SEND_KEYS	4
EXPECT_PREEDIT	と
SEND_KEYS	4
EXPECT_PREEDIT	っ
SEND_KEYS	4
EXPECT_PREEDIT	た

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	っ
UNDO_OR_REWIND
EXPECT_PREEDIT	と
UNDO_OR_REWIND
EXPECT_PREEDIT	て
UNDO_OR_REWIND
EXPECT_PREEDIT	つ
UNDO_OR_REWIND
EXPECT_PREEDIT	ち
UNDO_OR_REWIND
EXPECT_PREEDIT	た

# Make sure tapping '4' toggles the last character, not adding a new character.
SEND_KEYS	4
EXPECT_PREEDIT	ち

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	4
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	たた

RESET_CONTEXT
SEND_KEYS	44
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	ちた

RESET_CONTEXT
SEND_KEYS	444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	つた

RESET_CONTEXT
SEND_KEYS	4444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	てた

RESET_CONTEXT
SEND_KEYS	44444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	とた

RESET_CONTEXT
SEND_KEYS	444444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	った

# Test for Ta-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	4
EXPECT_PREEDIT	た
SEND_KEYS	*
EXPECT_PREEDIT	だ
SEND_KEYS	*
EXPECT_PREEDIT	た
SEND_KEYS	*
EXPECT_PREEDIT	だ
SEND_KEYS	*
EXPECT_PREEDIT	た
SEND_KEYS	4
EXPECT_PREEDIT	たた

RESET_CONTEXT
SEND_KEYS	4*
EXPECT_PREEDIT	だ
SEND_KEYS	4
EXPECT_PREEDIT	だた

RESET_CONTEXT
SEND_KEYS	44
EXPECT_PREEDIT	ち
SEND_KEYS	*
EXPECT_PREEDIT	ぢ
SEND_KEYS	*
EXPECT_PREEDIT	ち
SEND_KEYS	*
EXPECT_PREEDIT	ぢ
SEND_KEYS	*
EXPECT_PREEDIT	ち
SEND_KEYS	4
EXPECT_PREEDIT	ちた

RESET_CONTEXT
SEND_KEYS	44*
EXPECT_PREEDIT	ぢ
SEND_KEYS	4
EXPECT_PREEDIT	ぢた

RESET_CONTEXT
SEND_KEYS	444
EXPECT_PREEDIT	つ
SEND_KEYS	*
EXPECT_PREEDIT	っ
SEND_KEYS	*
EXPECT_PREEDIT	づ
SEND_KEYS	*
EXPECT_PREEDIT	つ
SEND_KEYS	*
EXPECT_PREEDIT	っ
SEND_KEYS	*
EXPECT_PREEDIT	づ
SEND_KEYS	*
EXPECT_PREEDIT	つ
SEND_KEYS	4
EXPECT_PREEDIT	つた

RESET_CONTEXT
SEND_KEYS	444*
EXPECT_PREEDIT	っ
SEND_KEYS	4
EXPECT_PREEDIT	った

RESET_CONTEXT
SEND_KEYS	444**
EXPECT_PREEDIT	づ
SEND_KEYS	4
EXPECT_PREEDIT	づた

RESET_CONTEXT
SEND_KEYS	4444
EXPECT_PREEDIT	て
SEND_KEYS	*
EXPECT_PREEDIT	で
SEND_KEYS	*
EXPECT_PREEDIT	て
SEND_KEYS	*
EXPECT_PREEDIT	で
SEND_KEYS	*
EXPECT_PREEDIT	て
SEND_KEYS	4
EXPECT_PREEDIT	てた

RESET_CONTEXT
SEND_KEYS	4444*
EXPECT_PREEDIT	で
SEND_KEYS	4
EXPECT_PREEDIT	でた

RESET_CONTEXT
SEND_KEYS	44444
EXPECT_PREEDIT	と
SEND_KEYS	*
EXPECT_PREEDIT	ど
SEND_KEYS	*
EXPECT_PREEDIT	と
SEND_KEYS	*
EXPECT_PREEDIT	ど
SEND_KEYS	*
EXPECT_PREEDIT	と
SEND_KEYS	4
EXPECT_PREEDIT	とた

RESET_CONTEXT
SEND_KEYS	44444*
EXPECT_PREEDIT	ど
SEND_KEYS	4
EXPECT_PREEDIT	どた

# Simple toggling on Na-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	5
EXPECT_PREEDIT	な
SEND_KEYS	5
EXPECT_PREEDIT	に
SEND_KEYS	5
EXPECT_PREEDIT	ぬ
SEND_KEYS	5
EXPECT_PREEDIT	ね
SEND_KEYS	5
EXPECT_PREEDIT	の
SEND_KEYS	5
EXPECT_PREEDIT	な

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	の
UNDO_OR_REWIND
EXPECT_PREEDIT	ね
UNDO_OR_REWIND
EXPECT_PREEDIT	ぬ
UNDO_OR_REWIND
EXPECT_PREEDIT	に
UNDO_OR_REWIND
EXPECT_PREEDIT	な

# Make sure tapping '5' toggles the last character, not adding a new character.
SEND_KEYS	5
EXPECT_PREEDIT	に

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	5
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	なな

RESET_CONTEXT
SEND_KEYS	55
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	にな

RESET_CONTEXT
SEND_KEYS	555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	ぬな

RESET_CONTEXT
SEND_KEYS	5555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	ねな

RESET_CONTEXT
SEND_KEYS	55555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	のな

# Simple toggling on Ha-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	6
EXPECT_PREEDIT	は
SEND_KEYS	6
EXPECT_PREEDIT	ひ
SEND_KEYS	6
EXPECT_PREEDIT	ふ
SEND_KEYS	6
EXPECT_PREEDIT	へ
SEND_KEYS	6
EXPECT_PREEDIT	ほ
SEND_KEYS	6
EXPECT_PREEDIT	は

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	ほ
UNDO_OR_REWIND
EXPECT_PREEDIT	へ
UNDO_OR_REWIND
EXPECT_PREEDIT	ふ
UNDO_OR_REWIND
EXPECT_PREEDIT	ひ
UNDO_OR_REWIND
EXPECT_PREEDIT	は

# Make sure tapping '6' toggles the last character, not adding a new character.
SEND_KEYS	6
EXPECT_PREEDIT	ひ

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	6
SEND_KEY	RIGHT
SEND_KEYS	6
EXPECT_PREEDIT	はは

RESET_CONTEXT
SEND_KEYS	66
SEND_KEY	RIGHT
SEND_KEYS	6
EXPECT_PREEDIT	ひは

RESET_CONTEXT
SEND_KEYS	666
SEND_KEY	RIGHT
SEND_KEYS	6
EXPECT_PREEDIT	ふは

RESET_CONTEXT
SEND_KEYS	6666
SEND_KEY	RIGHT
SEND_KEYS	6
EXPECT_PREEDIT	へは

RESET_CONTEXT
SEND_KEYS	66666
SEND_KEY	RIGHT
SEND_KEYS	6
EXPECT_PREEDIT	ほは

# Test for Ha-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	6
EXPECT_PREEDIT	は
SEND_KEYS	*
EXPECT_PREEDIT	ば
SEND_KEYS	*
EXPECT_PREEDIT	ぱ
SEND_KEYS	*
EXPECT_PREEDIT	は
SEND_KEYS	*
EXPECT_PREEDIT	ば
SEND_KEYS	*
EXPECT_PREEDIT	ぱ
SEND_KEYS	*
EXPECT_PREEDIT	は
SEND_KEYS	6
EXPECT_PREEDIT	はは

RESET_CONTEXT
SEND_KEYS	6*
EXPECT_PREEDIT	ば
SEND_KEYS	6
EXPECT_PREEDIT	ばは

RESET_CONTEXT
SEND_KEYS	6**
EXPECT_PREEDIT	ぱ
SEND_KEYS	6
EXPECT_PREEDIT	ぱは

RESET_CONTEXT
SEND_KEYS	66
EXPECT_PREEDIT	ひ
SEND_KEYS	*
EXPECT_PREEDIT	び
SEND_KEYS	*
EXPECT_PREEDIT	ぴ
SEND_KEYS	*
EXPECT_PREEDIT	ひ
SEND_KEYS	*
EXPECT_PREEDIT	び
SEND_KEYS	*
EXPECT_PREEDIT	ぴ
SEND_KEYS	*
EXPECT_PREEDIT	ひ
SEND_KEYS	6
EXPECT_PREEDIT	ひは

RESET_CONTEXT
SEND_KEYS	66*
EXPECT_PREEDIT	び
SEND_KEYS	6
EXPECT_PREEDIT	びは

RESET_CONTEXT
SEND_KEYS	66**
EXPECT_PREEDIT	ぴ
SEND_KEYS	6
EXPECT_PREEDIT	ぴは

RESET_CONTEXT
SEND_KEYS	666
EXPECT_PREEDIT	ふ
SEND_KEYS	*
EXPECT_PREEDIT	ぶ
SEND_KEYS	*
EXPECT_PREEDIT	ぷ
SEND_KEYS	*
EXPECT_PREEDIT	ふ
SEND_KEYS	*
EXPECT_PREEDIT	ぶ
SEND_KEYS	*
EXPECT_PREEDIT	ぷ
SEND_KEYS	*
EXPECT_PREEDIT	ふ
SEND_KEYS	6
EXPECT_PREEDIT	ふは

RESET_CONTEXT
SEND_KEYS	666*
EXPECT_PREEDIT	ぶ
SEND_KEYS	6
EXPECT_PREEDIT	ぶは

RESET_CONTEXT
SEND_KEYS	666**
EXPECT_PREEDIT	ぷ
SEND_KEYS	6
EXPECT_PREEDIT	ぷは

RESET_CONTEXT
SEND_KEYS	6666
EXPECT_PREEDIT	へ
SEND_KEYS	*
EXPECT_PREEDIT	べ
SEND_KEYS	*
EXPECT_PREEDIT	ぺ
SEND_KEYS	*
EXPECT_PREEDIT	へ
SEND_KEYS	*
EXPECT_PREEDIT	べ
SEND_KEYS	*
EXPECT_PREEDIT	ぺ
SEND_KEYS	*
EXPECT_PREEDIT	へ
SEND_KEYS	6
EXPECT_PREEDIT	へは

RESET_CONTEXT
SEND_KEYS	6666*
EXPECT_PREEDIT	べ
SEND_KEYS	6
EXPECT_PREEDIT	べは

RESET_CONTEXT
SEND_KEYS	6666**
EXPECT_PREEDIT	ぺ
SEND_KEYS	6
EXPECT_PREEDIT	ぺは

RESET_CONTEXT
SEND_KEYS	66666
EXPECT_PREEDIT	ほ
SEND_KEYS	*
EXPECT_PREEDIT	ぼ
SEND_KEYS	*
EXPECT_PREEDIT	ぽ
SEND_KEYS	*
EXPECT_PREEDIT	ほ
SEND_KEYS	*
EXPECT_PREEDIT	ぼ
SEND_KEYS	*
EXPECT_PREEDIT	ぽ
SEND_KEYS	*
EXPECT_PREEDIT	ほ
SEND_KEYS	6
EXPECT_PREEDIT	ほは

RESET_CONTEXT
SEND_KEYS	66666*
EXPECT_PREEDIT	ぼ
SEND_KEYS	6
EXPECT_PREEDIT	ぼは

RESET_CONTEXT
SEND_KEYS	66666**
EXPECT_PREEDIT	ぽ
SEND_KEYS	6
EXPECT_PREEDIT	ぽは

# Simple toggling on Ma-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	7
EXPECT_PREEDIT	ま
SEND_KEYS	7
EXPECT_PREEDIT	み
SEND_KEYS	7
EXPECT_PREEDIT	む
SEND_KEYS	7
EXPECT_PREEDIT	め
SEND_KEYS	7
EXPECT_PREEDIT	も
SEND_KEYS	7
EXPECT_PREEDIT	ま

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	も
UNDO_OR_REWIND
EXPECT_PREEDIT	め
UNDO_OR_REWIND
EXPECT_PREEDIT	む
UNDO_OR_REWIND
EXPECT_PREEDIT	み
UNDO_OR_REWIND
EXPECT_PREEDIT	ま

# Make sure tapping '7' toggles the last character, not adding a new character.
SEND_KEYS	7
EXPECT_PREEDIT	み

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	7
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	まま

RESET_CONTEXT
SEND_KEYS	77
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	みま

RESET_CONTEXT
SEND_KEYS	777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	むま

RESET_CONTEXT
SEND_KEYS	7777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	めま

RESET_CONTEXT
SEND_KEYS	77777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	もま

# Simple toggling on Ya-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	8
EXPECT_PREEDIT	や
SEND_KEYS	8
EXPECT_PREEDIT	ゆ
SEND_KEYS	8
EXPECT_PREEDIT	よ
SEND_KEYS	8
EXPECT_PREEDIT	ゃ
SEND_KEYS	8
EXPECT_PREEDIT	ゅ
SEND_KEYS	8
EXPECT_PREEDIT	ょ
SEND_KEYS	8
EXPECT_PREEDIT	や

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	ょ
UNDO_OR_REWIND
EXPECT_PREEDIT	ゅ
UNDO_OR_REWIND
EXPECT_PREEDIT	ゃ
UNDO_OR_REWIND
EXPECT_PREEDIT	よ
UNDO_OR_REWIND
EXPECT_PREEDIT	ゆ
UNDO_OR_REWIND
EXPECT_PREEDIT	や

# Make sure tapping '8' toggles the last character, not adding a new character.
SEND_KEYS	8
EXPECT_PREEDIT	ゆ

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	8
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	やや

RESET_CONTEXT
SEND_KEYS	88
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゆや

RESET_CONTEXT
SEND_KEYS	888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	よや

RESET_CONTEXT
SEND_KEYS	8888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゃや

RESET_CONTEXT
SEND_KEYS	88888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゅや

RESET_CONTEXT
SEND_KEYS	888888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ょや

# Test for Ya-row small characters
RESET_CONTEXT
SEND_KEYS	8
EXPECT_PREEDIT	や
SEND_KEYS	*
EXPECT_PREEDIT	ゃ
SEND_KEYS	*
EXPECT_PREEDIT	や
SEND_KEYS	*
EXPECT_PREEDIT	ゃ
SEND_KEYS	*
EXPECT_PREEDIT	や
SEND_KEYS	8
EXPECT_PREEDIT	やや

RESET_CONTEXT
SEND_KEYS	8*
EXPECT_PREEDIT	ゃ
SEND_KEYS	8
EXPECT_PREEDIT	ゃや

RESET_CONTEXT
SEND_KEYS	88
EXPECT_PREEDIT	ゆ
SEND_KEYS	*
EXPECT_PREEDIT	ゅ
SEND_KEYS	*
EXPECT_PREEDIT	ゆ
SEND_KEYS	*
EXPECT_PREEDIT	ゅ
SEND_KEYS	*
EXPECT_PREEDIT	ゆ
SEND_KEYS	8
EXPECT_PREEDIT	ゆや

RESET_CONTEXT
SEND_KEYS	88*
EXPECT_PREEDIT	ゅ
SEND_KEYS	8
EXPECT_PREEDIT	ゅや

RESET_CONTEXT
SEND_KEYS	888
EXPECT_PREEDIT	よ
SEND_KEYS	*
EXPECT_PREEDIT	ょ
SEND_KEYS	*
EXPECT_PREEDIT	よ
SEND_KEYS	*
EXPECT_PREEDIT	ょ
SEND_KEYS	*
EXPECT_PREEDIT	よ
SEND_KEYS	8
EXPECT_PREEDIT	よや

RESET_CONTEXT
SEND_KEYS	888*
EXPECT_PREEDIT	ょ
SEND_KEYS	8
EXPECT_PREEDIT	ょや

# Simple toggling on Ra-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	9
EXPECT_PREEDIT	ら
SEND_KEYS	9
EXPECT_PREEDIT	り
SEND_KEYS	9
EXPECT_PREEDIT	る
SEND_KEYS	9
EXPECT_PREEDIT	れ
SEND_KEYS	9
EXPECT_PREEDIT	ろ
SEND_KEYS	9
EXPECT_PREEDIT	ら

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	ろ
UNDO_OR_REWIND
EXPECT_PREEDIT	れ
UNDO_OR_REWIND
EXPECT_PREEDIT	る
UNDO_OR_REWIND
EXPECT_PREEDIT	り
UNDO_OR_REWIND
EXPECT_PREEDIT	ら

# Make sure tapping '9' toggles the last character, not adding a new character.
SEND_KEYS	9
EXPECT_PREEDIT	り

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	9
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	らら

RESET_CONTEXT
SEND_KEYS	99
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	りら

RESET_CONTEXT
SEND_KEYS	999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	るら

RESET_CONTEXT
SEND_KEYS	9999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	れら

RESET_CONTEXT
SEND_KEYS	99999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	ろら

# Simple toggling on Wa-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	0
EXPECT_PREEDIT	わ
SEND_KEYS	0
EXPECT_PREEDIT	を
SEND_KEYS	0
EXPECT_PREEDIT	ん
SEND_KEYS	0
EXPECT_PREEDIT	ゎ
SEND_KEYS	0
EXPECT_PREEDIT	ー
SEND_KEYS	0
EXPECT_PREEDIT	わ

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	ー
UNDO_OR_REWIND
EXPECT_PREEDIT	ゎ
UNDO_OR_REWIND
EXPECT_PREEDIT	ん
UNDO_OR_REWIND
EXPECT_PREEDIT	を
UNDO_OR_REWIND
EXPECT_PREEDIT	わ

# Make sure tapping '0' toggles the last character, not adding a new character.
SEND_KEYS	0
EXPECT_PREEDIT	を

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	0
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	わわ

RESET_CONTEXT
SEND_KEYS	00
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	をわ

RESET_CONTEXT
SEND_KEYS	000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	んわ

RESET_CONTEXT
SEND_KEYS	0000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	ゎわ

RESET_CONTEXT
SEND_KEYS	00000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	ーわ

# Test for a-row small characters
RESET_CONTEXT
SEND_KEYS	0
EXPECT_PREEDIT	わ
SEND_KEYS	*
EXPECT_PREEDIT	ゎ
SEND_KEYS	*
EXPECT_PREEDIT	わ
SEND_KEYS	*
EXPECT_PREEDIT	ゎ
SEND_KEYS	*
EXPECT_PREEDIT	わ
SEND_KEYS	0
EXPECT_PREEDIT	わわ

RESET_CONTEXT
SEND_KEYS	0*
EXPECT_PREEDIT	ゎ
SEND_KEYS	0
EXPECT_PREEDIT	ゎわ

# Simple toggling on symbols. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	#
EXPECT_PREEDIT	、
SEND_KEYS	#
EXPECT_PREEDIT	。
SEND_KEYS	#
EXPECT_PREEDIT	？
SEND_KEYS	#
EXPECT_PREEDIT	！
SEND_KEYS	#
EXPECT_PREEDIT	・
SEND_KEYS	#
# Full-width space
EXPECT_PREEDIT	　
SEND_KEYS	#
EXPECT_PREEDIT	、

# Then reverse order.
UNDO_OR_REWIND
# Full-width space
EXPECT_PREEDIT	　
UNDO_OR_REWIND
EXPECT_PREEDIT	・
UNDO_OR_REWIND
EXPECT_PREEDIT	！
UNDO_OR_REWIND
EXPECT_PREEDIT	？
UNDO_OR_REWIND
EXPECT_PREEDIT	。
UNDO_OR_REWIND
EXPECT_PREEDIT	、


# Make sure tapping '#' toggles the last character, not adding a new character.
SEND_KEYS	#
EXPECT_PREEDIT	。

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	#
SEND_KEY	RIGHT
SEND_KEYS	#
EXPECT_PREEDIT	、、

RESET_CONTEXT
SEND_KEYS	##
SEND_KEY	RIGHT
SEND_KEYS	#
EXPECT_PREEDIT	。、

RESET_CONTEXT
SEND_KEYS	###
SEND_KEY	RIGHT
SEND_KEYS	#
EXPECT_PREEDIT	？、

RESET_CONTEXT
SEND_KEYS	####
SEND_KEY	RIGHT
SEND_KEYS	#
EXPECT_PREEDIT	！、

RESET_CONTEXT
SEND_KEYS	#####
SEND_KEY	RIGHT
SEND_KEYS	#
EXPECT_PREEDIT	・、

RESET_CONTEXT
SEND_KEYS	######
SEND_KEY	RIGHT
SEND_KEYS	#
# FULLWIDTH-WHITESPACE followed by IDEOGRAPHIC-COMMA.
EXPECT_PREEDIT	　、
