add ptyc spawn test to toolchain category
Sends a valid JSON request to ptyc via stdin, verifies it parses the request (exit 2 = syscall failed, not exit 1 = bad request). Full PTY setup needs socketpair/SCM_RIGHTS which only PtySession provides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
f8e8ee3992
commit
e9e346cc2d
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"exported_at": "2026-04-26T12:16:59Z",
|
||||
"exported_at": "2026-04-26T13:07:25Z",
|
||||
"decisions": [
|
||||
{
|
||||
"id": "D-1",
|
||||
|
||||
@@ -173,6 +173,17 @@ class _ClideTestAppState extends State<ClideTestApp> {
|
||||
return 'exit=${r.exitCode} ${(r.stdout as String).trim()}';
|
||||
});
|
||||
|
||||
// ptyc stdin/stdout test — send a valid request, verify JSON response
|
||||
await _testAsync('ptyc spawn echo', () async {
|
||||
final proc = await Process.start(tc.ptyc, []);
|
||||
// Send a request for /bin/echo — simplest possible child
|
||||
proc.stdin.write('{"argv":["/bin/echo","hello"],"cwd":"/tmp","env":{},"cols":80,"rows":24}');
|
||||
await proc.stdin.close();
|
||||
final stdout = await proc.stdout.transform(const SystemEncoding().decoder).join();
|
||||
final exitCode = await proc.exitCode;
|
||||
return 'exit=$exitCode stdout=${stdout.trim().split('\n').first}';
|
||||
});
|
||||
|
||||
print('[testmode]');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user