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

Side by Side Diff: test/codegen/expect/corelib/regexp/bol-with-multiline_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('corelib/regexp/bol-with-multiline_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__bol$45with$45multiline_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const _interceptors = dart_sdk._interceptors;
8 const dart = dart_sdk.dart;
9 const dartx = dart_sdk.dartx;
10 const expect$ = expect.expect;
11 const bol$45with$45multiline_test = Object.create(null);
12 const v8_regexp_utils = Object.create(null);
13 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr ray$(core.String)))();
14 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.functionType(dart.void, [])))();
15 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String)) )();
16 let VoidTovoid$ = () => (VoidTovoid$ = dart.constFn(dart.definiteFunctionType( dart.void, [])))();
17 let dynamicAnddynamic__Tovoid = () => (dynamicAnddynamic__Tovoid = dart.constF n(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic], [core.Strin g])))();
18 let dynamic__Tovoid = () => (dynamic__Tovoid = dart.constFn(dart.definiteFunct ionType(dart.void, [dart.dynamic], [core.String])))();
19 let dynamic__Tovoid$ = () => (dynamic__Tovoid$ = dart.constFn(dart.definiteFun ctionType(dart.void, [dart.dynamic], [core.num])))();
20 let dynamicAnddynamicAndnumTovoid = () => (dynamicAnddynamicAndnumTovoid = dar t.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, core .num])))();
21 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT ype(dart.void, [dart.dynamic])))();
22 let StringAndRegExpToMatch = () => (StringAndRegExpToMatch = dart.constFn(dart .definiteFunctionType(core.Match, [core.String, core.RegExp])))();
23 let MatchToString = () => (MatchToString = dart.constFn(dart.definiteFunctionT ype(core.String, [core.Match])))();
24 let StringAndRegExpToListOfString = () => (StringAndRegExpToListOfString = dar t.constFn(dart.definiteFunctionType(ListOfString(), [core.String, core.RegExp])) )();
25 bol$45with$45multiline_test.main = function() {
26 v8_regexp_utils.description('Test for beginning of line (BOL or ^) matching in a multiline string</a>');
27 let s = "aced\nabc";
28 v8_regexp_utils.shouldBeNull(v8_regexp_utils.firstMatch(s, core.RegExp.new(" ^abc")));
29 v8_regexp_utils.shouldBe(v8_regexp_utils.firstMatch(s, core.RegExp.new("^abc ", {multiLine: true})), JSArrayOfString().of(["abc"]));
30 v8_regexp_utils.shouldBeNull(v8_regexp_utils.firstMatch(s, core.RegExp.new(" (^|X)abc")));
31 v8_regexp_utils.shouldBe(v8_regexp_utils.firstMatch(s, core.RegExp.new("(^|X )abc", {multiLine: true})), JSArrayOfString().of(["abc", ""]));
32 v8_regexp_utils.shouldBe(v8_regexp_utils.firstMatch(s, core.RegExp.new("(^a| Xa)bc", {multiLine: true})), JSArrayOfString().of(["abc", "a"]));
33 };
34 dart.fn(bol$45with$45multiline_test.main, VoidTovoid$());
35 v8_regexp_utils.assertEquals = function(actual, expected, message) {
36 if (message === void 0) message = null;
37 expect$.Expect.equals(actual, expected, message);
38 };
39 dart.fn(v8_regexp_utils.assertEquals, dynamicAnddynamic__Tovoid());
40 v8_regexp_utils.assertTrue = function(actual, message) {
41 if (message === void 0) message = null;
42 expect$.Expect.isTrue(actual, message);
43 };
44 dart.fn(v8_regexp_utils.assertTrue, dynamic__Tovoid());
45 v8_regexp_utils.assertFalse = function(actual, message) {
46 if (message === void 0) message = null;
47 expect$.Expect.isFalse(actual, message);
48 };
49 dart.fn(v8_regexp_utils.assertFalse, dynamic__Tovoid());
50 v8_regexp_utils.assertThrows = function(fn, testid) {
51 if (testid === void 0) testid = null;
52 expect$.Expect.throws(VoidTovoid()._check(fn), null, dart.str`Test ${testid} `);
53 };
54 dart.fn(v8_regexp_utils.assertThrows, dynamic__Tovoid$());
55 v8_regexp_utils.assertNull = function(actual, testid) {
56 if (testid === void 0) testid = null;
57 expect$.Expect.isNull(actual, dart.str`Test ${testid}`);
58 };
59 dart.fn(v8_regexp_utils.assertNull, dynamic__Tovoid$());
60 v8_regexp_utils.assertToStringEquals = function(str, match, testid) {
61 let actual = [];
62 for (let i = 0; i <= dart.notNull(core.num._check(dart.dload(match, 'groupCo unt'))); i++) {
63 let g = dart.dsend(match, 'group', i);
64 actual[dartx.add](g == null ? "" : g);
65 }
66 expect$.Expect.equals(str, actual[dartx.join](","), dart.str`Test ${testid}` );
67 };
68 dart.fn(v8_regexp_utils.assertToStringEquals, dynamicAnddynamicAndnumTovoid()) ;
69 v8_regexp_utils.shouldBeTrue = function(actual) {
70 expect$.Expect.isTrue(actual);
71 };
72 dart.fn(v8_regexp_utils.shouldBeTrue, dynamicTovoid());
73 v8_regexp_utils.shouldBeFalse = function(actual) {
74 expect$.Expect.isFalse(actual);
75 };
76 dart.fn(v8_regexp_utils.shouldBeFalse, dynamicTovoid());
77 v8_regexp_utils.shouldBeNull = function(actual) {
78 expect$.Expect.isNull(actual);
79 };
80 dart.fn(v8_regexp_utils.shouldBeNull, dynamicTovoid());
81 v8_regexp_utils.shouldBe = function(actual, expected, message) {
82 if (message === void 0) message = null;
83 if (expected == null) {
84 expect$.Expect.isNull(actual, message);
85 } else {
86 expect$.Expect.equals(dart.dload(expected, 'length'), dart.dsend(dart.dloa d(actual, 'groupCount'), '+', 1));
87 for (let i = 0; i <= dart.notNull(core.num._check(dart.dload(actual, 'grou pCount'))); i++) {
88 expect$.Expect.equals(dart.dindex(expected, i), dart.dsend(actual, 'grou p', i), message);
89 }
90 }
91 };
92 dart.fn(v8_regexp_utils.shouldBe, dynamicAnddynamic__Tovoid());
93 v8_regexp_utils.firstMatch = function(str, pattern) {
94 return pattern.firstMatch(str);
95 };
96 dart.fn(v8_regexp_utils.firstMatch, StringAndRegExpToMatch());
97 v8_regexp_utils.allStringMatches = function(str, pattern) {
98 return pattern.allMatches(str)[dartx.map](core.String)(dart.fn(m => m.group( 0), MatchToString()))[dartx.toList]();
99 };
100 dart.fn(v8_regexp_utils.allStringMatches, StringAndRegExpToListOfString());
101 v8_regexp_utils.description = function(str) {
102 };
103 dart.fn(v8_regexp_utils.description, dynamicTovoid());
104 // Exports:
105 exports.bol$45with$45multiline_test = bol$45with$45multiline_test;
106 exports.v8_regexp_utils = v8_regexp_utils;
107 });
OLDNEW
« no previous file with comments | « test/codegen/expect/corelib/regexp/backreferences_test.js ('k') | test/codegen/expect/corelib/regexp/bol_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698