Skip to content

Commit

Permalink
Merge branch 'master' into recompile-host.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch committed Jan 21, 2025
2 parents bff9a9d + 7fc9521 commit 88d8fd9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
2 changes: 2 additions & 0 deletions integration_tests/wasm/test/hello_world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.

@TestOn('wasm')
// TODO: https://github.com/dart-lang/test/issues/2288
@OnPlatform({'firefox': Skip()})
// This retry is a regression test for https://github.com/dart-lang/test/issues/2006
@Retry(2)
library;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/checks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Add `containsMatchingInOrder` and `containsEqualInOrder` to replace the
combined functionality in `containsInOrder`.
- Replace `pairwiseComparesTo` with `pairwiseMatches`.
- Fix a bug where printing the result of a failed deep quality check would
fail with a `TypeError` when comparing large `Map` instances
- Increase SDK constraint to ^3.5.0.

## 0.3.0
Expand Down
5 changes: 3 additions & 2 deletions pkgs/checks/lib/src/describe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ Iterable<String> _prettyPrint(
Iterable<String> _prettyPrintCollection(
String open, String close, List<Iterable<String>> elements, int maxLength) {
if (elements.length > _maxItems) {
elements.replaceRange(_maxItems - 1, elements.length, [
const ellipsisElement = [
['...']
]);
];
elements.replaceRange(_maxItems - 1, elements.length, ellipsisElement);
}
if (elements.every((e) => e.length == 1)) {
final singleLine = '$open${elements.map((e) => e.single).join(', ')}$close';
Expand Down
30 changes: 30 additions & 0 deletions pkgs/checks/test/pretty_print_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2025, 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:checks/checks.dart';
import 'package:checks/context.dart';
import 'package:test/scaffolding.dart';

void main() {
group('literal', () {
group('truncates large collections', () {
const maxUntruncatedCollection = 25;
final largeList =
List<int>.generate(maxUntruncatedCollection + 1, (i) => i);
test('in lists', () {
check(literal(largeList)).last.equals('...]');
});
test('in sets', () {
check(literal(largeList.toSet())).last.equals('...}');
});
test('in iterables', () {
check(literal(largeList.followedBy([]))).last.equals('...)');
});
test('in maps', () {
final map = Map<int, int>.fromIterables(largeList, largeList);
check(literal(map)).last.equals('...}');
});
});
});
}
1 change: 0 additions & 1 deletion pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## 1.25.15-wip


## 1.25.14

* Use secure random for url secrets.
Expand Down
1 change: 1 addition & 0 deletions pkgs/test/lib/src/runner/browser/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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.

// ignore: deprecated_member_use
import 'dart:js_util' as js_util;

import 'package:js/js.dart';
Expand Down
1 change: 1 addition & 0 deletions pkgs/test/lib/src/runner/browser/post_message_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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.

// ignore: deprecated_member_use
import 'dart:js_util';

import 'package:stream_channel/stream_channel.dart';
Expand Down
8 changes: 2 additions & 6 deletions pkgs/test/tool/host.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,8 @@ MultiChannel<dynamic> _connectToServer() {
/// the key 'exception' set to true and details in the value for 'data' (coming
/// from `dart.js` due to a load exception).
///
/// Legacy bootstrap implementations send a `{'ready': true}` message as a
/// signal for this host to create a [MessageChannel] and send the port through
/// the frame's `window.onMessage` channel.
///
/// Upcoming bootstrap implementations will send the string 'port' and include a
/// port for a prepared [MessageChannel].
/// Bootstrap implementations send the string 'port' and include a port for a
/// prepared [MessageChannel].
///
/// Returns a [StreamChannel] which will be connected to the frame once the
/// message channel port is active.
Expand Down

0 comments on commit 88d8fd9

Please sign in to comment.