blob: c91252b9435e79731a95b729dd1cb6adb6e7043d [file] [log] [blame] [edit]
// Copyright (c) 2023, 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:async';
import 'package:meta/meta.dart';
import 'package:test/test.dart';
@isTest
void testWithFormatting<T>(
dynamic description,
T Function() body, {
String? testOn,
Timeout? timeout,
dynamic skip,
dynamic tags,
Map<String, dynamic>? onPlatform,
int? retry,
}) {
test(
description,
() => withFormatting(body),
testOn: testOn,
timeout: timeout,
skip: skip,
tags: tags,
onPlatform: onPlatform,
retry: retry,
);
}
T withFormatting<T>(T Function() callback) =>
runZoned(callback, zoneValues: {#test.allowFormatting: true});