flutter/dev/devicelab/test/utils_test.dart
Matan Lurey a7997f606e
Update dev/devicelab/** to provide --local-engine-host. (#132342)
Partial work towards https://github.com/flutter/flutter/issues/132245.

I have to admit I don't totally understand what I've updated, or whether
there are more integration points needed.
2023-08-10 17:25:30 -07:00

45 lines
1.2 KiB
Dart

// 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:flutter_devicelab/framework/utils.dart';
import 'common.dart';
void main() {
group('grep', () {
test('greps lines', () {
expect(grep('b', from: 'ab\ncd\nba'), <String>['ab', 'ba']);
});
test('understands RegExp', () {
expect(grep(RegExp('^b'), from: 'ab\nba'), <String>['ba']);
});
});
group('parse service', () {
const String badOutput = 'No uri here';
const String sampleOutput = 'A Dart VM Service on '
'Pixel 3 XL is available at: http://127.0.0.1:9090/LpjUpsdEjqI=/';
test('uri', () {
expect(parseServiceUri(sampleOutput),
Uri.parse('http://127.0.0.1:9090/LpjUpsdEjqI=/'));
expect(parseServiceUri(badOutput), null);
});
test('port', () {
expect(parseServicePort(sampleOutput), 9090);
expect(parseServicePort(badOutput), null);
});
});
group('engine environment declarations', () {
test('localEngine', () {
expect(localEngineFromEnv, null);
expect(localEngineHostFromEnv, null);
expect(localEngineSrcPathFromEnv, null);
});
});
}