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

Unified Diff: test/codegen/expect/lib/convert/chunked_conversion2_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
Index: test/codegen/expect/lib/convert/chunked_conversion2_test.js
diff --git a/test/codegen/expect/lib/convert/chunked_conversion2_test.js b/test/codegen/expect/lib/convert/chunked_conversion2_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..49d8f0ac700a8ceac55f80175d6a4c1af84d4d96
--- /dev/null
+++ b/test/codegen/expect/lib/convert/chunked_conversion2_test.js
@@ -0,0 +1,75 @@
+dart_library.library('lib/convert/chunked_conversion2_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__chunked_conversion2_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const convert = dart_sdk.convert;
+ const _interceptors = dart_sdk._interceptors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const chunked_conversion2_test = Object.create(null);
+ let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(core.int)))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ chunked_conversion2_test.MyByteSink = class MyByteSink extends convert.ByteConversionSinkBase {
+ new() {
+ this.accumulator = [];
+ }
+ add(bytes) {
+ this.accumulator[dartx.add](bytes);
+ }
+ close() {}
+ };
+ dart.setSignature(chunked_conversion2_test.MyByteSink, {
+ methods: () => ({
+ add: dart.definiteFunctionType(dart.void, [core.List$(core.int)]),
+ close: dart.definiteFunctionType(dart.void, [])
+ })
+ });
+ chunked_conversion2_test.testBase = function() {
+ let byteSink = new chunked_conversion2_test.MyByteSink();
+ let bytes = JSArrayOfint().of([1]);
+ byteSink.addSlice(bytes, 0, 1, false);
+ bytes[dartx.set](0, 2);
+ byteSink.addSlice(bytes, 0, 1, true);
+ expect$.Expect.equals(1, dart.dindex(byteSink.accumulator[dartx.get](0), 0));
+ expect$.Expect.equals(2, dart.dindex(byteSink.accumulator[dartx.get](1), 0));
+ };
+ dart.fn(chunked_conversion2_test.testBase, VoidTovoid());
+ chunked_conversion2_test.MyChunkedSink = class MyChunkedSink extends convert.ChunkedConversionSink$(core.List$(core.int)) {
+ new() {
+ this.accumulator = [];
+ super.new();
+ }
+ add(bytes) {
+ this.accumulator[dartx.add](bytes);
+ }
+ close() {}
+ };
+ dart.addSimpleTypeTests(chunked_conversion2_test.MyChunkedSink);
+ dart.setSignature(chunked_conversion2_test.MyChunkedSink, {
+ methods: () => ({
+ add: dart.definiteFunctionType(dart.void, [core.List$(core.int)]),
+ close: dart.definiteFunctionType(dart.void, [])
+ })
+ });
+ chunked_conversion2_test.testAdapter = function() {
+ let chunkedSink = new chunked_conversion2_test.MyChunkedSink();
+ let byteSink = convert.ByteConversionSink.from(chunkedSink);
+ let bytes = JSArrayOfint().of([1]);
+ byteSink.addSlice(bytes, 0, 1, false);
+ bytes[dartx.set](0, 2);
+ byteSink.addSlice(bytes, 0, 1, true);
+ expect$.Expect.equals(1, dart.dindex(chunkedSink.accumulator[dartx.get](0), 0));
+ expect$.Expect.equals(2, dart.dindex(chunkedSink.accumulator[dartx.get](1), 0));
+ };
+ dart.fn(chunked_conversion2_test.testAdapter, VoidTovoid());
+ chunked_conversion2_test.main = function() {
+ chunked_conversion2_test.testBase();
+ chunked_conversion2_test.testAdapter();
+ };
+ dart.fn(chunked_conversion2_test.main, VoidTovoid());
+ // Exports:
+ exports.chunked_conversion2_test = chunked_conversion2_test;
+});

Powered by Google App Engine
This is Rietveld 408576698