Cross-implementation tests that verify the Go port produces identical behavior to xterm.js.
- Test cases are defined in
testcases.mjs— each specifies terminal dimensions, input sequences, and optionally a resize operation. generate.mjsruns each test case through@xterm/headlessand captures the resulting terminal state (cursor position, line content, cell attributes, scrollback) as JSON.conformance_test.goreads the golden JSON and runs the same inputs through the Goxterm.Terminal, comparing the output.
When xterm.js is updated or test cases are added:
cd conformance
yarn
node generate.mjsThen run the Go tests:
cd ..
go test -run TestConformance -vAdd entries to testcases.mjs. Each test case has:
{
name: "descriptive_name", // unique test name
cols: 80, rows: 24, // terminal dimensions
input: "...", // escape sequences to write
resize: { cols: 40, rows: 12 }, // optional: resize after input
captureResponse: true, // optional: capture DA/DSR responses
}- Cursor position (x, y)
- Line text content (trimmed)
- Line wrap flags
- Per-cell attributes (fg/bg color, color mode, bold, italic, underline, etc.)
- Scrollback content
- Terminal responses (DA1, DSR)
If the Go port behavior differs from xterm.js, xterm.js is correct. Fix the Go port.