2 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Opus 4.7 155af91e66 test sweep: close small terminal coverage gaps (T-91)
test / unit + widget + golden + a11y (push) Failing after 36s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Four targeted tests covering the last single-line/short-tail gaps
in the terminal tree: the PointerInputs.none / .all const
constructors, the abstract TerminalMouseHandler const constructor
(reached via a private subclass), the reflow-output-padding branch
in Buffer.resize (line < newHeight), and the wide-char skip in
TerminalPainter.paintLine.

Coverage: pointer_input 1/3 -> 3/3; mouse/handler 33/34 -> 34/34;
buffer/buffer 260/261 -> 261/261; painter 120/121 -> 121/121.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:03:47 +02:00
jpmschweitzerandClaude Opus 4.7 eb32422e05 drop dead pql.decisions.coverage IPC command
The 'pql decisions coverage' subcommand was removed in pql 1.4.x — the
replacement is the 'coverage_gaps' field on 'pql plan status'. No
production callers used this IPC surface; only the unit test referenced
it.

Removes the IPC registration, the PqlClient helper, and the matching
test case. Net negative LOC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:03:40 +02:00
4 changed files with 59 additions and 20 deletions
-9
View File
@@ -169,15 +169,6 @@ void registerPqlCommands(DaemonDispatcher d, PqlClient pql) {
}
});
d.register('pql.decisions.coverage', (req) async {
try {
final gaps = await pql.decisionCoverage();
return IpcResponse.ok(id: req.id, data: {'gaps': gaps});
} on PqlException catch (e) {
return _pqlError(req.id, e);
}
});
d.register('pql.tickets.list', (req) async {
try {
final results = await pql.ticketList(
-4
View File
@@ -106,10 +106,6 @@ class PqlClient {
return _runObject(['decisions', 'read', id]);
}
Future<List<Map<String, Object?>>> decisionCoverage() async {
return _runList(['decisions', 'coverage']);
}
Future<List<Map<String, Object?>>> ticketList({
String? status,
String? team,
-7
View File
@@ -95,13 +95,6 @@ void main() {
expect(r.error!.kind, 'user_error');
});
test('pql.decisions.coverage returns gaps', () async {
await call('pql.decisions.sync');
final r = await call('pql.decisions.coverage');
expect(r.ok, isTrue);
expect(r.data.containsKey('gaps'), isTrue);
});
test('pql.tickets.board returns columns', () async {
final r = await call('pql.tickets.board');
expect(r.ok, isTrue);
+59
View File
@@ -0,0 +1,59 @@
/// Closeout tests for the last single-digit-uncovered lines in
/// `lib/src/terminal/`: pointer_input constructors, the abstract
/// TerminalMouseHandler constructor, the reflow padding branch in
/// Buffer.resize, and the wide-char skip branch in
/// TerminalPainter.paintLine.
library;
import 'dart:ui';
import 'package:clide/src/terminal/src/core/mouse/handler.dart';
import 'package:clide/src/terminal/src/terminal.dart';
import 'package:clide/src/terminal/src/ui/painter.dart';
import 'package:clide/src/terminal/src/ui/pointer_input.dart';
import 'package:clide/src/terminal/src/ui/terminal_text_style.dart';
import 'package:clide/src/terminal/src/ui/themes.dart';
import 'package:flutter/painting.dart';
import 'package:test/test.dart';
class _StubMouseHandler extends TerminalMouseHandler {
const _StubMouseHandler();
@override
String? call(TerminalMouseEvent event) => null;
}
void main() {
test('PointerInputs.none / .all produce expected sets', () {
expect(const PointerInputs.none().inputs, isEmpty);
expect(const PointerInputs.all().inputs, containsAll(PointerInput.values));
});
test('TerminalMouseHandler abstract const constructor is reachable via a subclass', () {
const h = _StubMouseHandler();
expect(h, isA<TerminalMouseHandler>());
});
test('Buffer.resize pads reflow output up to the new height', () {
final t = Terminal(maxLines: 200, onOutput: (_) {});
// Write content narrower than the new width — reflow should produce
// fewer lines than newHeight, triggering the pad-with-empty-lines
// branch in buffer.dart.
t.write('abc\r\n');
// Resize to a wide + tall viewport.
t.resize(40, 50, 8, 16);
expect(t.buffer.lines.length, greaterThanOrEqualTo(50));
});
test('TerminalPainter.paintLine handles wide (CJK) cells without skipping the skip', () {
final t = Terminal(maxLines: 100, onOutput: (_) {});
// CJK ideograph — terminal stores it as a width-2 cell, so paintLine
// advances `i` twice and the wide-char branch fires.
t.write('漢字');
final p = TerminalPainter(
theme: TerminalThemes.defaultTheme,
textStyle: const TerminalStyle(),
textScaler: const TextScaler.linear(1.0),
);
p.paintLine(Canvas(PictureRecorder()), Offset.zero, t.buffer.lines[0]);
});
}