Added more tests.
This commit is contained in:
parent
64d60bbf4e
commit
cdf9a43b5f
2 changed files with 12 additions and 0 deletions
1
test.sh
1
test.sh
|
@ -7,6 +7,7 @@ GREEN='\033[0;32m'
|
||||||
|
|
||||||
for o in -A -b -e -E -n -s -t -T -v
|
for o in -A -b -e -E -n -s -t -T -v
|
||||||
do
|
do
|
||||||
|
echo -e "Testing: cat $o"
|
||||||
cat $o test/* > $TMPCAT
|
cat $o test/* > $TMPCAT
|
||||||
bin/dcat $o test/* > $TMPDCAT
|
bin/dcat $o test/* > $TMPDCAT
|
||||||
if ! $(diff -q $TMPCAT $TMPDCAT);
|
if ! $(diff -q $TMPCAT $TMPDCAT);
|
||||||
|
|
|
@ -254,6 +254,17 @@ void main() {
|
||||||
expect(lines.last, equals(sampleText));
|
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 {
|
test('cat source', () async {
|
||||||
final tmp = makeTmpFile();
|
final tmp = makeTmpFile();
|
||||||
await cat([sourceFile], tmp.openWrite());
|
await cat([sourceFile], tmp.openWrite());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue