mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-10 21:27:01 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
21 lines
586 B
Dart
21 lines
586 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:todo/cli/cli_runner.dart';
|
|
|
|
void main() {
|
|
group('readInput', () {
|
|
test('returns empty for an interactive terminal', () async {
|
|
expect(await readInput(const Stream.empty(), hasTerminal: true), '');
|
|
});
|
|
|
|
test('decodes the whole stream and trims trailing whitespace', () async {
|
|
final input = Stream<List<int>>.fromIterable([
|
|
utf8.encode('ab'),
|
|
utf8.encode('c\n\n'),
|
|
]);
|
|
expect(await readInput(input, hasTerminal: false), 'abc');
|
|
});
|
|
});
|
|
}
|