Reland fuchsia_remote_debug_protocol allows open port on remote device (#66271)

This commit is contained in:
Satsuki Ueno
2020-09-22 12:17:05 -07:00
committed by GitHub
parent 82bd7cf894
commit bf41c78255
5 changed files with 254 additions and 67 deletions

View File

@@ -0,0 +1,24 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:fuchsia_remote_debug_protocol/src/common/network.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
final List<String> ipv4Addresses = <String>['127.0.0.1', '8.8.8.8'];
final List<String> ipv6Addresses = <String>['::1',
'fe80::8eae:4cff:fef4:9247', 'fe80::8eae:4cff:fef4:9247%e0'];
group('test validation', () {
test('isIpV4Address', () {
expect(ipv4Addresses.map(isIpV4Address), everyElement(isTrue));
expect(ipv6Addresses.map(isIpV4Address), everyElement(isFalse));
});
test('isIpV6Address', () {
expect(ipv4Addresses.map(isIpV6Address), everyElement(isFalse));
expect(ipv6Addresses.map(isIpV6Address), everyElement(isTrue));
});
});
}