GHHG10/CodeServer / opencode /packages /core /test /pty /info-schema.test.ts
GHHG10's picture
download
raw
734 Bytes
import { describe, expect, test } from "bun:test"
import { Schema } from "effect"
import { Pty } from "@opencode-ai/core/pty"
const sample = (pid: number) => ({
id: "pty_01J5Y5H0AH4Q4NXJ6P4C3P5V2K",
title: "demo",
command: "cmd.exe",
args: [],
cwd: "C:\\",
status: "running",
pid,
})
describe("Pty.Info", () => {
test("accepts pid 0 (Windows ConPTY assigns the pid asynchronously)", () => {
expect(Schema.decodeUnknownSync(Pty.Info)(sample(0)).pid).toBe(0)
})
test("accepts a positive pid", () => {
expect(Schema.decodeUnknownSync(Pty.Info)(sample(48012)).pid).toBe(48012)
})
test("rejects a negative pid", () => {
expect(() => Schema.decodeUnknownSync(Pty.Info)(sample(-1))).toThrow()
})
})

Xet Storage Details

Size:
734 Bytes
·
Xet hash:
23db73911ca762c9e506ef035dcc182c462b3ab0423981d36a51419333694829

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.