mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-10-19 16:17:03 +00:00
test: keep the decomposed-grapheme and reconnect-cancel tests
Each catches a plausible wrong change that passes every kept test: mapping the first scalar under a locked Ctrl turns é into \x05, and a reconnect that does not fail pending reads leaves them hanging until the 30 s timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
23909ded5b
commit
0ba172278d
@@ -159,6 +159,34 @@ void main() {
|
||||
expect((await second).path, '/same');
|
||||
});
|
||||
|
||||
test('session invalidation cancels active and waiting reads', () async {
|
||||
final sent = <_SentRead>[];
|
||||
final fileFetcher = FileFetcher(
|
||||
() => _sessionId,
|
||||
readRemoteDirectory: (_, path, includeHidden) async {
|
||||
sent.add(_SentRead(path, includeHidden));
|
||||
},
|
||||
);
|
||||
final first = fileFetcher.fetchDirectory('/same', false, false);
|
||||
final waiting = fileFetcher.fetchDirectory('/same', false, true);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
final firstError = expectLater(first, throwsA(isA<StateError>()));
|
||||
final waitingError = expectLater(waiting, throwsA(isA<StateError>()));
|
||||
|
||||
fileFetcher.beginRemoteSession();
|
||||
|
||||
await firstError;
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(sent.map((request) => request.includeHidden), [false]);
|
||||
await waitingError;
|
||||
expect(fileFetcher.hasPendingRemoteRead('/same'), isFalse);
|
||||
final replacement = fileFetcher.fetchDirectory('/same', false, true);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(sent.map((request) => request.includeHidden), [false, true]);
|
||||
fileFetcher.tryCompleteTask(_directoryJson('/same'), 'false');
|
||||
expect((await replacement).path, '/same');
|
||||
});
|
||||
|
||||
test('navigation ignores stale directory responses', () async {
|
||||
final fileFetcher = FileFetcher(
|
||||
() => _sessionId,
|
||||
|
||||
@@ -123,6 +123,23 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps decomposed graphemes intact with locked keyboard modifiers',
|
||||
() {
|
||||
const decomposedEAcute = 'é';
|
||||
|
||||
expect(
|
||||
prepareTerminalInputPayload(
|
||||
decomposedEAcute,
|
||||
source: TerminalInputSource.keyboard,
|
||||
isMobileOrWebMobile: true,
|
||||
bracketedPasteMode: false,
|
||||
ctrlLocked: true,
|
||||
altLocked: false,
|
||||
),
|
||||
decomposedEAcute,
|
||||
);
|
||||
});
|
||||
|
||||
test('wraps paste without applying locked modifiers', () {
|
||||
expect(
|
||||
prepareTerminalInputPayload(
|
||||
|
||||
Reference in New Issue
Block a user