Files
sdk/pkg/dart2bytecode/test/dart2bytecode_test.dart
T
Ivan Inozemtsev a5b890f90d [dart2bytecode] Allow adding prefixes to bytecode-compiled libraries.
This enables sharing (by duplicating) the common code not included into the host app between dynamic modules.

Bug: b/475757441
Change-Id: I4831fc8b996303691ea2311019d1957f52c7d40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478370
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2026-02-10 12:26:20 -08:00

19 lines
713 B
Dart

// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// 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.
import 'package:dart2bytecode/dart2bytecode.dart' show prefixUri;
import 'package:test/test.dart';
void main() {
group('prefixUri', () {
test('prefixes file URIs', () {
expect(prefixUri(Uri.parse('file:///foo/bar.dart'), ['pre', 'fix']),
Uri.parse('file:///pre/fix/foo/bar.dart'));
});
test('prefixes package URIs', () {
expect(prefixUri(Uri.parse('package:foo/bar.dart'), ['pre', 'fix']),
Uri.parse('package:pre.fix.foo/bar.dart'));
});
});
}