summaryrefslogtreecommitdiff
path: root/test/soak.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 02:31:20 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitf749eb712d990a9b03f1db372d5311e77bd32edd (patch)
treeee4d9966f1eb293054b7ed865c9d4d6eb49e432b /test/soak.py
parent8f6621f9f70db86d56266a59b56dfb92b324b0d9 (diff)
parentb3d32656413734952bc918c2d4cfd12fede6c214 (diff)
downloadpardes-f749eb712d990a9b03f1db372d5311e77bd32edd.tar.gz
pardes-f749eb712d990a9b03f1db372d5311e77bd32edd.zip
integration: the terminal behind src/Term.zig, with the diff viewer and the plumber's first phase
A merge of term-phase0 and pardes-next. File.zig's recolorSyntax keeps the theme's grounds and names Term.Filter and Term.Span; the changelog keeps both sides' entries, the palette sentence in the place of the entry the terminal work cut down. core-test 985/985 on tui; the diff, pager and tree process cases pass, goldens unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/soak.py')
-rw-r--r--test/soak.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/soak.py b/test/soak.py
index 401cb84e..faf447ab 100644
--- a/test/soak.py
+++ b/test/soak.py
@@ -148,6 +148,15 @@ def fixture(at, rng):
sub.mkdir(exist_ok=True)
(sub / 'inner.txt').write_text(''.join(f'inner {i} {rng.choice(WORDS)}\n' for i in range(60)))
(sub / 'more.md').write_text('# More\n\n' + ''.join(f'- item {i} {rng.choice(WORDS)}\n' for i in range(40)))
+ # A repository whose last commit changes code.zig, for act_gitshow.
+ if shutil.which('git'):
+ git = ['git', '-c', 'user.name=soak', '-c', 'user.email=soak@invalid', '-c', 'init.defaultBranch=main']
+ subprocess.run(git + ['init', '-q'], cwd=at, check=True)
+ subprocess.run(git + ['add', 'code.zig'], cwd=at, check=True)
+ subprocess.run(git + ['commit', '-qm', 'code'], cwd=at, check=True)
+ code = (at / 'code.zig').read_text().replace('return x * 7 +', 'return x * 8 +').replace('pub fn f9(', 'pub fn nine(')
+ (at / 'code.zig').write_text(code)
+ subprocess.run(git + ['commit', '-qam', 'change'], cwd=at, check=True)
# ---- terminals ----
@@ -681,6 +690,16 @@ def act_shell(c, rng, k):
k(rng.choice([b'k', b'j', b'']))
+def act_gitshow(c, rng, k):
+ # A commit paged into `pardes -` (git's pager): the +Pager restacked into
+ # a +Diff, whose rows come from the files the step reads (hunks.zig).
+ k(b' nt')
+ time.sleep(rng.uniform(0.8, 1.5))
+ k(b'git show HEAD | "$(readlink /proc/$PPID/exe)" -\r')
+ time.sleep(rng.uniform(1.0, 2.0))
+ k(b'\x02')
+
+
def act_window(c, rng, k):
# Enter ends window mode, as a person would: left open, it took the next
# action's keys, and a `k` at a column's top went to its tag, where `SPC q` ran Exit
@@ -762,7 +781,7 @@ ACTIONS = [
('panes', 3, act_panes), ('find', 3, act_find), ('shell', 3, act_shell), ('window', 4, act_window),
('column', 1, act_column), ('del', 2, act_del), ('new', 2, act_new), ('esc', 4, act_esc),
('click', 8, act_click), ('wheel', 8, act_wheel), ('hover', 6, act_hover), ('paste', 2, act_paste),
- ('settings', 1, act_settings), ('idle', 6, act_idle),
+ ('settings', 1, act_settings), ('gitshow', 1, act_gitshow), ('idle', 6, act_idle),
]