forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Platform.script
for flutter_tester (flutter#46911)
This addresses the problem in flutter/flutter#12847 which changed slightly over time. Today, `Platform.script` does not give an empty `file` URI, it gives something like `file://path/to/package/main.dart` _regardless of how the file is actually named_. After this change, it will give the absolute path to the file being run under test. So before this change, the new test would have a URI like ``` file:///Users/dnfield/src/flutter/engine/src/main.dart ``` And now it has ``` file:///Users/dnfield/src/flutter/engine/src/out/host_debug_unopt_arm64/gen/platform_test.dart.dill ``` This is going to be helpful in generating relative paths from the test file.
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2013 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 'dart:io'; | ||
|
||
import 'package:litetest/litetest.dart'; | ||
|
||
void main() { | ||
test('Platform.script has right URI', () async { | ||
// Platform.script should look like file:///path/to/engine/src/out/variant/gen/platform_test.dart.dill | ||
expect(Platform.script.path, endsWith('gen/platform_test.dart.dill')); | ||
}); | ||
} |