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

Side by Side Diff: test/codegen/expect/corelib/regexp/malformed-escapes_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/malformed-escapes_test', null, /* Imports * /[
2 'dart_sdk',
3 'expect'
4 ], function load__malformed$45escapes_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const dart = dart_sdk.dart;
8 const dartx = dart_sdk.dartx;
9 const expect$ = expect.expect;
10 const malformed$45escapes_test = Object.create(null);
11 const v8_regexp_utils = Object.create(null);
12 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.functionType(dart.void, [])))();
13 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String)) )();
14 let VoidTovoid$ = () => (VoidTovoid$ = dart.constFn(dart.definiteFunctionType( dart.void, [])))();
15 let dynamicAnddynamic__Tovoid = () => (dynamicAnddynamic__Tovoid = dart.constF n(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic], [core.Strin g])))();
16 let dynamic__Tovoid = () => (dynamic__Tovoid = dart.constFn(dart.definiteFunct ionType(dart.void, [dart.dynamic], [core.String])))();
17 let dynamic__Tovoid$ = () => (dynamic__Tovoid$ = dart.constFn(dart.definiteFun ctionType(dart.void, [dart.dynamic], [core.num])))();
18 let dynamicAnddynamicAndnumTovoid = () => (dynamicAnddynamicAndnumTovoid = dar t.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynamic, core .num])))();
19 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT ype(dart.void, [dart.dynamic])))();
20 let StringAndRegExpToMatch = () => (StringAndRegExpToMatch = dart.constFn(dart .definiteFunctionType(core.Match, [core.String, core.RegExp])))();
21 let MatchToString = () => (MatchToString = dart.constFn(dart.definiteFunctionT ype(core.String, [core.Match])))();
22 let StringAndRegExpToListOfString = () => (StringAndRegExpToListOfString = dar t.constFn(dart.definiteFunctionType(ListOfString(), [core.String, core.RegExp])) )();
23 malformed$45escapes_test.main = function() {
24 v8_regexp_utils.description("This page tests handling of malformed escape se quences.");
25 let regexp = null;
26 regexp = core.RegExp.new("\\ug", {multiLine: true});
27 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', 'ug'));
28 regexp = core.RegExp.new("\\xg", {multiLine: true});
29 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', 'xg'));
30 regexp = core.RegExp.new("\\c_", {multiLine: true});
31 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', '\\\\c_'));
32 regexp = core.RegExp.new("[\\B]", {multiLine: true});
33 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', 'B'));
34 regexp = core.RegExp.new("[\\b]", {multiLine: true});
35 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', '\b'));
36 regexp = core.RegExp.new("\\8", {multiLine: true});
37 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', '\\8'));
38 regexp = core.RegExp.new("^[\\c]$");
39 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', 'c'));
40 regexp = core.RegExp.new("^[\\c_]$");
41 v8_regexp_utils.shouldBeFalse(dart.dsend(regexp, 'hasMatch', 'c'));
42 regexp = core.RegExp.new("^[\\c]]$");
43 v8_regexp_utils.shouldBeTrue(dart.dsend(regexp, 'hasMatch', 'c]'));
44 };
45 dart.fn(malformed$45escapes_test.main, VoidTovoid$());
46 v8_regexp_utils.assertEquals = function(actual, expected, message) {
47 if (message === void 0) message = null;
48 expect$.Expect.equals(actual, expected, message);
49 };
50 dart.fn(v8_regexp_utils.assertEquals, dynamicAnddynamic__Tovoid());
51 v8_regexp_utils.assertTrue = function(actual, message) {
52 if (message === void 0) message = null;
53 expect$.Expect.isTrue(actual, message);
54 };
55 dart.fn(v8_regexp_utils.assertTrue, dynamic__Tovoid());
56 v8_regexp_utils.assertFalse = function(actual, message) {
57 if (message === void 0) message = null;
58 expect$.Expect.isFalse(actual, message);
59 };
60 dart.fn(v8_regexp_utils.assertFalse, dynamic__Tovoid());
61 v8_regexp_utils.assertThrows = function(fn, testid) {
62 if (testid === void 0) testid = null;
63 expect$.Expect.throws(VoidTovoid()._check(fn), null, dart.str`Test ${testid} `);
64 };
65 dart.fn(v8_regexp_utils.assertThrows, dynamic__Tovoid$());
66 v8_regexp_utils.assertNull = function(actual, testid) {
67 if (testid === void 0) testid = null;
68 expect$.Expect.isNull(actual, dart.str`Test ${testid}`);
69 };
70 dart.fn(v8_regexp_utils.assertNull, dynamic__Tovoid$());
71 v8_regexp_utils.assertToStringEquals = function(str, match, testid) {
72 let actual = [];
73 for (let i = 0; i <= dart.notNull(core.num._check(dart.dload(match, 'groupCo unt'))); i++) {
74 let g = dart.dsend(match, 'group', i);
75 actual[dartx.add](g == null ? "" : g);
76 }
77 expect$.Expect.equals(str, actual[dartx.join](","), dart.str`Test ${testid}` );
78 };
79 dart.fn(v8_regexp_utils.assertToStringEquals, dynamicAnddynamicAndnumTovoid()) ;
80 v8_regexp_utils.shouldBeTrue = function(actual) {
81 expect$.Expect.isTrue(actual);
82 };
83 dart.fn(v8_regexp_utils.shouldBeTrue, dynamicTovoid());
84 v8_regexp_utils.shouldBeFalse = function(actual) {
85 expect$.Expect.isFalse(actual);
86 };
87 dart.fn(v8_regexp_utils.shouldBeFalse, dynamicTovoid());
88 v8_regexp_utils.shouldBeNull = function(actual) {
89 expect$.Expect.isNull(actual);
90 };
91 dart.fn(v8_regexp_utils.shouldBeNull, dynamicTovoid());
92 v8_regexp_utils.shouldBe = function(actual, expected, message) {
93 if (message === void 0) message = null;
94 if (expected == null) {
95 expect$.Expect.isNull(actual, message);
96 } else {
97 expect$.Expect.equals(dart.dload(expected, 'length'), dart.dsend(dart.dloa d(actual, 'groupCount'), '+', 1));
98 for (let i = 0; i <= dart.notNull(core.num._check(dart.dload(actual, 'grou pCount'))); i++) {
99 expect$.Expect.equals(dart.dindex(expected, i), dart.dsend(actual, 'grou p', i), message);
100 }
101 }
102 };
103 dart.fn(v8_regexp_utils.shouldBe, dynamicAnddynamic__Tovoid());
104 v8_regexp_utils.firstMatch = function(str, pattern) {
105 return pattern.firstMatch(str);
106 };
107 dart.fn(v8_regexp_utils.firstMatch, StringAndRegExpToMatch());
108 v8_regexp_utils.allStringMatches = function(str, pattern) {
109 return pattern.allMatches(str)[dartx.map](core.String)(dart.fn(m => m.group( 0), MatchToString()))[dartx.toList]();
110 };
111 dart.fn(v8_regexp_utils.allStringMatches, StringAndRegExpToListOfString());
112 v8_regexp_utils.description = function(str) {
113 };
114 dart.fn(v8_regexp_utils.description, dynamicTovoid());
115 // Exports:
116 exports.malformed$45escapes_test = malformed$45escapes_test;
117 exports.v8_regexp_utils = v8_regexp_utils;
118 });
OLDNEW
« no previous file with comments | « test/codegen/expect/corelib/regexp/loop-capture_test.js ('k') | test/codegen/expect/corelib/regexp/many-brackets_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698