From 90e4f67876c2608c53c18396229ff6df82615147 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 15 Jun 2023 23:50:49 +0000 Subject: [PATCH] Allow matcher for suiteJson path argument. Ignore case --- pkgs/test/test/runner/json_reporter_test.dart | 2 +- pkgs/test/test/runner/json_reporter_utils.dart | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/test/test/runner/json_reporter_test.dart b/pkgs/test/test/runner/json_reporter_test.dart index d987a4b08..934d89a63 100644 --- a/pkgs/test/test/runner/json_reporter_test.dart +++ b/pkgs/test/test/runner/json_reporter_test.dart @@ -558,7 +558,7 @@ void customTest(String name, dynamic Function() testFn) => test(name, testFn); useRelativePath: false, [ [ - suiteJson(0, path: path), + suiteJson(0, path: equalsIgnoringCase(path)), testStartJson( 1, allOf(startsWith('loading '), endsWith('test.dart')), groupIDs: []), diff --git a/pkgs/test/test/runner/json_reporter_utils.dart b/pkgs/test/test/runner/json_reporter_utils.dart index ddb73b489..bbdbb78f0 100644 --- a/pkgs/test/test/runner/json_reporter_utils.dart +++ b/pkgs/test/test/runner/json_reporter_utils.dart @@ -61,15 +61,16 @@ Map _allSuitesJson({int count = 1}) => /// Returns the event emitted by the JSON reporter indicating that a suite has /// begun running. /// -/// The [platform] defaults to `"vm"`, the [path] defaults to `"test.dart"`. +/// The [platform] defaults to `'vm'`. +/// The [path] defaults to `equals('test.dart')`. Map suiteJson(int id, - {String platform = 'vm', String path = 'test.dart'}) => + {String platform = 'vm', Matcher? path}) => { 'type': 'suite', 'suite': { 'id': id, 'platform': platform, - 'path': path, + 'path': path ?? 'test.dart', } };