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

Unified Diff: test/codegen/expect/corelib/uri_ipv4_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/expect/corelib/uri_http_test.js ('k') | test/codegen/expect/corelib/uri_ipv6_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/corelib/uri_ipv4_test.js
diff --git a/test/codegen/expect/corelib/uri_ipv4_test.js b/test/codegen/expect/corelib/uri_ipv4_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..4cb0ffe23623b0edad87db8975d8a0f14b7cf4a8
--- /dev/null
+++ b/test/codegen/expect/corelib/uri_ipv4_test.js
@@ -0,0 +1,46 @@
+dart_library.library('corelib/uri_ipv4_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__uri_ipv4_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const _interceptors = dart_sdk._interceptors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const uri_ipv4_test = Object.create(null);
+ let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))();
+ let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(core.int)))();
+ let StringAndListOfintTovoid = () => (StringAndListOfintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String, ListOfint()])))();
+ let VoidToListOfint = () => (VoidToListOfint = dart.constFn(dart.definiteFunctionType(ListOfint(), [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let StringTovoid = () => (StringTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.String])))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ uri_ipv4_test.testParseIPv4Address = function() {
+ function pass(host, out) {
+ expect$.Expect.listEquals(core.Uri.parseIPv4Address(host), out);
+ }
+ dart.fn(pass, StringAndListOfintTovoid());
+ function fail(host) {
+ expect$.Expect.throws(dart.fn(() => core.Uri.parseIPv4Address(host), VoidToListOfint()), dart.fn(e => core.FormatException.is(e), dynamicTobool()));
+ }
+ dart.fn(fail, StringTovoid());
+ pass('127.0.0.1', JSArrayOfint().of([127, 0, 0, 1]));
+ pass('128.0.0.1', JSArrayOfint().of([128, 0, 0, 1]));
+ pass('255.255.255.255', JSArrayOfint().of([255, 255, 255, 255]));
+ pass('0.0.0.0', JSArrayOfint().of([0, 0, 0, 0]));
+ fail('127.0.0.-1');
+ fail('255.255.255.256');
+ fail('0.0.0.0.');
+ fail('0.0.0.0.0');
+ fail('a.0.0.0');
+ fail('0.0..0');
+ };
+ dart.fn(uri_ipv4_test.testParseIPv4Address, VoidTovoid());
+ uri_ipv4_test.main = function() {
+ uri_ipv4_test.testParseIPv4Address();
+ };
+ dart.fn(uri_ipv4_test.main, VoidTovoid());
+ // Exports:
+ exports.uri_ipv4_test = uri_ipv4_test;
+});
« no previous file with comments | « test/codegen/expect/corelib/uri_http_test.js ('k') | test/codegen/expect/corelib/uri_ipv6_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698