Skip to content

Commit

Permalink
test(ping): ensure it can work cross platform
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-jones committed Mar 13, 2020
1 parent 0156cc7 commit ed34f14
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/dexeca_test.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import 'dart:io';
import 'package:test/test.dart';
import 'package:dexeca/dexeca.dart';

void main() {
test('dexeca', () async {
var proc = await dexeca('ping', ['1.1.1.1'], inheritStdio: false);
var proc =
await dexeca('ping', _pingArgs('127.0.0.1'), inheritStdio: false);
expect(proc.exitCode, equals(0));
expect(proc.stderr, equals(''));
expect(proc.stdout, contains('1.1.1.1'));
expect(proc.stdout, contains('127.0.0.1'));
});
}

List<String> _pingArgs(String target) {
if (Platform.isWindows) {
return [target];
} else {
return ['-c', '4', target];
}
}

0 comments on commit ed34f14

Please sign in to comment.