blob: 6c4bd0dbbb37ba850d4417d6c3415dc7df4c552f [file] [log] [blame]
// Copyright (c) 2020, 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.
// @dart = 2.9
import "package:expect/expect.dart";
// See
// The following code must not throw.
void main() {
var regExp = RegExp(r'\w+');
var message = 'Hello world!';
var match = regExp.firstMatch(message);
var groupNames = match.groupNames.toList();
Expect.listEquals([], groupNames);
Expect.throwsArgumentError(() => match.namedGroup("x"));