test sweep: cover utils/ + core/mouse/ (T-91)
Adds two test files closing the last two pure-Dart sub-areas in `lib/src/terminal/src/`: `test/terminal/utils/utils_test.dart` — 51 tests covering: - Ascii.isNonPrintable (control chars + DEL). - hashValues (every optional arg slot, 2..20 inclusive) + hashList (including the documented zero-on-empty short-circuit). - ByteConsumer (single-block + cross-block consume, peek's consume-rollback path, rollback within block + across consumed blocks, rollbackTo, unrefConsumedBlocks, reset). - IndexAwareCircularBuffer (push/trim, pushAll, pop, [] / []=, clear, forEach, remove with count clamp / no-op, insert in the middle / at end / at full ring, insertAll, trimStart, replaceWith with truncate-from-head, swap, maxLength setter incl. error + no-op cases, debugDump, IndexedItem mixin attach/detach/index). - UnicodeV11.wcwidth (control chars, printable ASCII, DEL+C1, combining marks BMP+high-plane, wide chars BMP+high-plane, unmapped high-plane default, version field). - The push wrap branch where _startIndex resets to 0 after a full revolution (last circular_buffer line). `test/terminal/mouse/mouse_test.dart` — 21 tests covering: - TerminalMouseButton ids + isWheel for the 7 enum values. - MouseReporter for all four MouseReportMode shapes (normal with >223 null-byte clamp, utf with the 2015-limit clamp, sgr's M/m pair, urxvt's button+32 / 3-on-up encoding). - TerminalMouseEvent constructor. - CascadeMouseHandler first-non-null semantics. - ClickMouseHandler — only fires on clickOnly + down + button id < 3; null otherwise. UpDownMouseHandler — fires on every upDownScroll* mode; drops wheel-up; passes wheel-down. Default defaultMouseHandler routes through both. Coverage delta: - utils/ascii.dart: 0/2 → 2/2. - utils/byte_consumer.dart: 28/42 → 42/42. - utils/circular_buffer.dart: 71/130 → 130/130. - utils/hash_values.dart: 16/36 → 36/36. - utils/unicode_v11.dart: 16/27 → 27/27. - core/mouse/handler.dart: 3/34 → 34/34. - core/mouse/reporter.dart: 0/17 → 17/17. - (utils/char_code.dart, utils/lookup_table.dart already at 100% from earlier reflow + parser work; mouse/button.dart, mouse/button_state.dart, mouse/mode.dart are pure enums with no executable lines.) - Total project: 54.62% → 56.40%; coverage_floor bumped 54 → 56. Two pre-existing `// ignore_for_file: constant_identifier_names` suppressions that lacked documented reasons get inline justifications: - `lib/src/terminal/src/utils/ascii.dart` — RFC 20 / ISO 646 control-character names; lowerCamelCase would diverge from every spec/man-page reference. - `lib/src/terminal/src/utils/unicode_v11.dart` — Unicode 11 wcwidth tables vendored as-is; future re-vendoring stays a verbatim paste. Both fall under the same "FFI / spec-shaped names" pattern as the libc.dart suppression (D-66 era). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
// Based on xterm.dart v4.0.0 by xuty (MIT). See LICENSE in this directory.
|
||||
|
||||
// The constants below mirror the historical ASCII control-character
|
||||
// names from RFC 20 / ISO 646 (NULL, SOH, STX, ETX, EOT, ENQ, ACK, BEL,
|
||||
// BS, HT, LF, VT, FF, CR, SO, SI, DLE, DC1..4, NAK, SYN, ETB, CAN, EM,
|
||||
// SUB, ESC, FS, GS, RS, US, DEL). Renaming them to lowerCamelCase
|
||||
// would diverge from every spec, man page, and upstream reference the
|
||||
// reader is likely to consult — the lint works against the file.
|
||||
//
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
abstract class Ascii {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
// Based on xterm.dart v4.0.0 by xuty (MIT). See LICENSE in this directory.
|
||||
|
||||
// `BMP_COMBINING`, `HIGH_COMBINING`, `BMP_WIDE`, `HIGH_WIDE` are the
|
||||
// names used by the upstream Unicode 11 wcwidth tables (xterm.dart
|
||||
// vendored from the standard wcwidth implementation). Renaming them
|
||||
// to lowerCamelCase would force every diff against an updated upstream
|
||||
// table to be re-translated; keep the spec-shaped names so future
|
||||
// re-vendoring is a verbatim paste.
|
||||
//
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
import 'dart:typed_data';
|
||||
|
||||
Reference in New Issue
Block a user