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

Unified Diff: test/codegen/expect/corelib/uri_scheme_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_query_test.js ('k') | test/codegen/expect/corelib/uri_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_scheme_test.js
diff --git a/test/codegen/expect/corelib/uri_scheme_test.js b/test/codegen/expect/corelib/uri_scheme_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..02200c7fea0e2247f6f76dc791e3ac9ca8e20e3b
--- /dev/null
+++ b/test/codegen/expect/corelib/uri_scheme_test.js
@@ -0,0 +1,49 @@
+dart_library.library('corelib/uri_scheme_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__uri_scheme_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const uri_scheme_test = Object.create(null);
+ let VoidToUri = () => (VoidToUri = dart.constFn(dart.definiteFunctionType(core.Uri, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ let StringAndStringAndStringTodynamic = () => (StringAndStringAndStringTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [core.String, core.String, core.String])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ uri_scheme_test.testInvalidArguments = function() {
+ expect$.Expect.throws(dart.fn(() => core.Uri.new({scheme: "_"}), VoidToUri()), dart.fn(e => core.FormatException.is(e), dynamicTobool()));
+ expect$.Expect.throws(dart.fn(() => core.Uri.new({scheme: "http_s"}), VoidToUri()), dart.fn(e => core.FormatException.is(e), dynamicTobool()));
+ expect$.Expect.throws(dart.fn(() => core.Uri.new({scheme: "127.0.0.1:80"}), VoidToUri()), dart.fn(e => core.FormatException.is(e), dynamicTobool()));
+ };
+ dart.fn(uri_scheme_test.testInvalidArguments, VoidTovoid());
+ uri_scheme_test.testScheme = function() {
+ function test(expectedScheme, expectedUri, scheme) {
+ let uri = core.Uri.new({scheme: scheme});
+ expect$.Expect.equals(expectedScheme, uri.scheme);
+ expect$.Expect.equals(expectedUri, dart.toString(uri));
+ uri = core.Uri.parse(dart.str`${scheme}:`);
+ expect$.Expect.equals(expectedScheme, uri.scheme);
+ expect$.Expect.equals(expectedUri, dart.toString(uri));
+ }
+ dart.fn(test, StringAndStringAndStringTodynamic());
+ test("http", "http:", "http");
+ test("http", "http:", "HTTP");
+ test("http", "http:", "hTTP");
+ test("http", "http:", "Http");
+ test("http+ssl", "http+ssl:", "HTTP+ssl");
+ test("urn", "urn:", "urn");
+ test("urn", "urn:", "UrN");
+ test("a123.432", "a123.432:", "a123.432");
+ };
+ dart.fn(uri_scheme_test.testScheme, VoidTovoid());
+ uri_scheme_test.main = function() {
+ uri_scheme_test.testInvalidArguments();
+ uri_scheme_test.testScheme();
+ };
+ dart.fn(uri_scheme_test.main, VoidTodynamic());
+ // Exports:
+ exports.uri_scheme_test = uri_scheme_test;
+});
« no previous file with comments | « test/codegen/expect/corelib/uri_query_test.js ('k') | test/codegen/expect/corelib/uri_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698