Files
sdk/pkg/dynamic_modules/test/data/load_unmodifiable_view/main.dart
T
Mayank Patke c66f91be23 [dynamic_modules] Update pubspec to 3.8 and reformat.
Change-Id: I7cdfb0000996a711bdee9b1618c20a21bbdda814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427620
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
2025-05-08 14:52:34 -07:00

20 lines
633 B
Dart

// Copyright (c) 2024, 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 'dart:typed_data';
import '../../common/testing.dart' as helper;
import 'package:expect/expect.dart';
/// Dynamic module can be loaded from unmodifiable view.
void main() async {
final result = await helper.load(
'entry1.dart',
transformBytes: (Uint8List bytes) =>
bytes.buffer.asUint8List(0, bytes.lengthInBytes).asUnmodifiableView(),
);
Expect.equals(42, result);
helper.done();
}