Forward port API docs creation realm handling from prior script (#132867)

It looks like the logic added here:


https://github.com/flutter/flutter/pull/131951/files#diff-297ee4cfe6d9bffc2fa1376918a50b8e4165ada4569575880c40811b6f749265R18

got dropped in the refactor here:

https://github.com/flutter/flutter/pull/132710
This commit is contained in:
Zachary Anderson
2023-08-18 15:33:27 -07:00
committed by GitHub
parent 1bdef6fea7
commit d5a162b788
2 changed files with 24 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:path/path.dart' as path;
import 'package:platform/platform.dart';
import 'package:pub_semver/pub_semver.dart';
import 'package:test/test.dart';
@@ -179,6 +180,17 @@ void main() {
expect(info['dartSdkVersion'], isNotNull);
expect(info['dartSdkVersion'], equals(Version.parse('2.14.0-360.0.dev')));
});
test('the engine realm is read from the engine.realm file', () async {
const String flutterRoot = '/home/user/flutter';
final File realmFile = memoryFileSystem.file(
path.join(flutterRoot, 'bin', 'internal', 'engine.realm',
));
realmFile.writeAsStringSync('realm');
setUpWithEnvironment(<String, String>{'FLUTTER_ROOT': flutterRoot});
expect(fakeProcessManager, hasNoRemainingExpectations);
final Map<String, dynamic> info = flutterInformation.getFlutterInformation();
expect(info['engineRealm'], equals('realm'));
});
});
}