Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: test/codegen/corelib/reg_exp_first_match_test.dart

Issue 1945153002: Add corelib tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: error_test and range_error_test now pass Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/corelib/reg_exp_all_matches_test.dart ('k') | test/codegen/corelib/reg_exp_group_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/corelib/reg_exp_first_match_test.dart
diff --git a/test/codegen/language/closure_test.dart b/test/codegen/corelib/reg_exp_first_match_test.dart
similarity index 54%
copy from test/codegen/language/closure_test.dart
copy to test/codegen/corelib/reg_exp_first_match_test.dart
index 9dc3a90994cdb2eacce12f69a85c70a4f549f95c..40e38fa109ccd9184765c8b2dfadf39c202023a6 100644
--- a/test/codegen/language/closure_test.dart
+++ b/test/codegen/corelib/reg_exp_first_match_test.dart
@@ -1,24 +1,18 @@
// 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 closures.
import "package:expect/expect.dart";
-class A {
- var field;
- A(this.field) {}
-}
+// Dart test program for RegExp.firstMatch.
-class ClosureTest {
+class RegExpFirstMatchTest {
static testMain() {
- var o = new A(3);
- foo() => o.field++;
- Expect.equals(3, foo());
- Expect.equals(4, o.field);
+ Expect.equals('cat', new RegExp("(\\w+)").firstMatch("cat dog")[0]);
+ Expect.equals(null, new RegExp("foo").firstMatch("bar"));
}
}
main() {
- ClosureTest.testMain();
+ RegExpFirstMatchTest.testMain();
}
« no previous file with comments | « test/codegen/corelib/reg_exp_all_matches_test.dart ('k') | test/codegen/corelib/reg_exp_group_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698