Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add end-to-end tests for Mustachio AOT compiler #2664

Merged
merged 12 commits into from Jun 3, 2021
6 changes: 4 additions & 2 deletions test/mustachio/render_tests_test.dart
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// This test does not need to be run on all platforms.
@OnPlatform({'windows': Skip()})
import 'dart:io';
import 'dart:isolate' show Isolate;

Expand All @@ -18,6 +16,10 @@ void main() {
var dartdocLibUri = await Isolate.resolvePackageUri(
Uri.parse('package:dartdoc/dartdoc.dart'));
var dartdocPath = p.dirname(p.dirname(dartdocLibUri.path));
// Correct Windows issue path coming out of [Isolate.resolvePackageUri].
if (dartdocPath.startsWith(p.windows.separator)) {
dartdocPath = dartdocPath.substring(1).replaceAll('/', p.separator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so weird that pkg:path doesn't "do the right thing" here!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is curious. I think the issue is that Isolate.resolvePackageUri gives a Uri like file:///C:/one/two, which maybe isn't incorrect because URIs should always have /, even on Windows? And then I ask for the .path out of that, which gives /C:/one/two and now we're in trouble.

}
var runtimeRendererRenderTest = File(p.join(dartdocPath, 'test',
'mustachio', 'runtime_renderer_render_test.dart'))
.readAsLinesSync();
Expand Down