| Index: test/codegen_expected/language/no_such_method_mock_test.js
|
| diff --git a/test/codegen_expected/language/no_such_method_mock_test.js b/test/codegen_expected/language/no_such_method_mock_test.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9e23c66ab7343ffdaa54c2d1d40b6ca3b36a176d
|
| --- /dev/null
|
| +++ b/test/codegen_expected/language/no_such_method_mock_test.js
|
| @@ -0,0 +1,48 @@
|
| +dart_library.library('language/no_such_method_mock_test', null, /* Imports */[
|
| + 'dart_sdk',
|
| + 'expect'
|
| +], function load__no_such_method_mock_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 no_such_method_mock_test = Object.create(null);
|
| + let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core.int, [])))();
|
| + let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
|
| + no_such_method_mock_test.Cat = class Cat extends core.Object {
|
| + eatFood(food) {
|
| + return true;
|
| + }
|
| + scratch(furniture) {
|
| + return 100;
|
| + }
|
| + };
|
| + dart.setSignature(no_such_method_mock_test.Cat, {
|
| + methods: () => ({
|
| + eatFood: dart.definiteFunctionType(core.bool, [core.String]),
|
| + scratch: dart.definiteFunctionType(core.int, [core.String])
|
| + })
|
| + });
|
| + no_such_method_mock_test.MockCat = class MockCat extends core.Object {
|
| + noSuchMethod(invocation) {
|
| + return core.String.as(invocation.positionalArguments[dartx.get](0))[dartx.isNotEmpty];
|
| + }
|
| + eatFood(food) {
|
| + return core.bool._check(this.noSuchMethod(new dart.InvocationImpl('eatFood', [food], {isMethod: true})));
|
| + }
|
| + scratch(furniture) {
|
| + return core.int._check(this.noSuchMethod(new dart.InvocationImpl('scratch', [furniture], {isMethod: true})));
|
| + }
|
| + };
|
| + no_such_method_mock_test.MockCat[dart.implements] = () => [no_such_method_mock_test.Cat];
|
| + no_such_method_mock_test.main = function() {
|
| + let mock = new no_such_method_mock_test.MockCat();
|
| + expect$.Expect.isTrue(dart.dsend(mock, 'eatFood', "food"));
|
| + expect$.Expect.isFalse(mock.eatFood(""));
|
| + expect$.Expect.throws(dart.fn(() => dart.notNull(mock.scratch("couch")) + 0, VoidToint()));
|
| + };
|
| + dart.fn(no_such_method_mock_test.main, VoidTovoid());
|
| + // Exports:
|
| + exports.no_such_method_mock_test = no_such_method_mock_test;
|
| +});
|
|
|