Added more tests.
This commit is contained in:
parent
64d60bbf4e
commit
cdf9a43b5f
2 changed files with 12 additions and 0 deletions
|
@ -254,6 +254,17 @@ void main() {
|
|||
expect(lines.last, equals(sampleText));
|
||||
});
|
||||
|
||||
test('cat file - source', () async {
|
||||
final tmp = makeTmpFile();
|
||||
final result = await cat([sampleFile, '-'], tmp.openWrite(),
|
||||
input: File(sourceFile).openRead());
|
||||
expect(result.isSuccess, true, reason: 'result is success');
|
||||
final lines = await tmp.readAsLines();
|
||||
expect(lines.first, startsWith('Lorem'), reason: 'Lorem in first line');
|
||||
expect(lines.last.endsWith('✓'), false,
|
||||
reason: "doesn't end with checkmark");
|
||||
});
|
||||
|
||||
test('cat source', () async {
|
||||
final tmp = makeTmpFile();
|
||||
await cat([sourceFile], tmp.openWrite());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue