Skip to content

Commit 021eca7

Browse files
committed
Improve the test script.
1 parent 644e8f3 commit 021eca7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/chewing_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def run_test():
156156
activate_window(random.choice(target_windows))
157157
time.sleep(1)
158158

159-
for i in range(5000):
159+
for i in range(n):
160160
phrase, keys = random.choice(phrases)
161161
try:
162162
print(i, phrase, keys)
@@ -171,16 +171,16 @@ def run_test():
171171
press_key('\r')
172172
press_key('\r')
173173

174-
# 按下 Ctrl + space (10% 機率發生)
175-
if random.random() < 0.1:
174+
# 按下 Ctrl + space (30% 機率發生)
175+
if random.random() < 0.3:
176176
time.sleep(0.5)
177177
keybd_event(VK_CONTROL, 0, 0, 0)
178178
press_key(' ')
179179
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0)
180180
time.sleep(0.5)
181181

182-
# 按下 shift 0.3 秒後後放開 (10% 機率發生)
183-
if random.random() < 0.1:
182+
# 按下 shift 0.3 秒後後放開 (30% 機率發生)
183+
if random.random() < 0.3:
184184
press_key(VK_SHIFT, hold=0.3)
185185

186186
# 按下[下方向鍵] 開啟選字 (20% 機率發生)
@@ -193,8 +193,8 @@ def run_test():
193193
else:
194194
press_key(VK_ESCAPE) # 按下 ESC 關閉選字清單
195195

196-
# 切換視窗 (10% 發生率)
197-
if len(target_windows) > 1 and random.random() < 0.1:
196+
# 切換視窗 (20% 發生率)
197+
if len(target_windows) > 1 and random.random() < 0.2:
198198
"""
199199
# Alt + Tab
200200
time.sleep(0.5)

0 commit comments

Comments
 (0)