
My last entry was in December of 2009. I suppose I never was particularly good about updating this thing, but it seems a bit ridiculous that I couldn't be bothered to post once about the many, many things that have gone on since then. My apologies. I guess I could start by saying that the world looks like a very different place than it did back in second year.
+ +'''; + String extensions = 'jpg|jpeg|png'; + String? tag = findImageTag_(text, extensions); + Expect.isNotNull(tag); + } +} + +main() { + RegExp2Test.testMain(); +} diff --git a/tests/language/reg_exp/reg_exp3_test.dart b/tests/language/reg_exp/reg_exp3_test.dart new file mode 100644 index 00000000000..cb375a5bcf1 --- /dev/null +++ b/tests/language/reg_exp/reg_exp3_test.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2011, 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 test for testing regular expressions in Dart. + +import "package:expect/expect.dart"; + +class RegExp3Test { + static testMain() { + var i = 2000; + try { + RegExp exp = new RegExp("["); + i = 100; // Should not reach here. + } on FormatException catch (e) { + i = 0; + } + Expect.equals(0, i); + } +} + +main() { + RegExp3Test.testMain(); +} diff --git a/tests/language/reg_exp/reg_exp4_test.dart b/tests/language/reg_exp/reg_exp4_test.dart new file mode 100644 index 00000000000..208f1bd71c5 --- /dev/null +++ b/tests/language/reg_exp/reg_exp4_test.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2011, 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 test for testing regular expressions in Dart. + +class RegEx2Test { + static void testMain() { + final helloPattern = new RegExp("with (hello)"); + String s = "this is a string with hello somewhere"; + Match? match = helloPattern.firstMatch(s); + if (match != null) { + print("got match"); + int groupCount = match.groupCount; + print("groupCount is $groupCount"); + print("group 0 is ${match.group(0)}"); + print("group 1 is ${match.group(1)}"); + } else { + print("match not round"); + } + print("done"); + } +} + +main() { + RegEx2Test.testMain(); +} diff --git a/tests/language/reg_exp/reg_exp_test.dart b/tests/language/reg_exp/reg_exp_test.dart new file mode 100644 index 00000000000..f606600a02f --- /dev/null +++ b/tests/language/reg_exp/reg_exp_test.dart @@ -0,0 +1,84 @@ +// Copyright (c) 2011, 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 test for testing regular expressions in Dart. + +import "package:expect/expect.dart"; + +void main() { + RegExp exp = new RegExp(r"(\w+)"); + String str = "Parse my string"; + List