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

Side by Side Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 1026093002: Fix hints in the analyzer package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/task/model.dart ('k') | pkg/analyzer/test/generated/ast_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.all_the_rest_test; 8 library engine.all_the_rest_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 3304 matching lines...) Expand 10 before | Expand all | Expand 10 after
3315 } 3315 }
3316 3316
3317 void test_logicalAnd_false_false() { 3317 void test_logicalAnd_false_false() {
3318 _assertLogicalAnd(_boolValue(false), _boolValue(false), _boolValue(false)); 3318 _assertLogicalAnd(_boolValue(false), _boolValue(false), _boolValue(false));
3319 } 3319 }
3320 3320
3321 void test_logicalAnd_false_null() { 3321 void test_logicalAnd_false_null() {
3322 try { 3322 try {
3323 _assertLogicalAnd(_boolValue(false), _boolValue(false), _nullValue()); 3323 _assertLogicalAnd(_boolValue(false), _boolValue(false), _nullValue());
3324 fail("Expected EvaluationException"); 3324 fail("Expected EvaluationException");
3325 } on EvaluationException catch (exception) {} 3325 } on EvaluationException {}
3326 } 3326 }
3327 3327
3328 void test_logicalAnd_false_string() { 3328 void test_logicalAnd_false_string() {
3329 try { 3329 try {
3330 _assertLogicalAnd( 3330 _assertLogicalAnd(
3331 _boolValue(false), _boolValue(false), _stringValue("false")); 3331 _boolValue(false), _boolValue(false), _stringValue("false"));
3332 fail("Expected EvaluationException"); 3332 fail("Expected EvaluationException");
3333 } on EvaluationException catch (exception) {} 3333 } on EvaluationException {}
3334 } 3334 }
3335 3335
3336 void test_logicalAnd_false_true() { 3336 void test_logicalAnd_false_true() {
3337 _assertLogicalAnd(_boolValue(false), _boolValue(false), _boolValue(true)); 3337 _assertLogicalAnd(_boolValue(false), _boolValue(false), _boolValue(true));
3338 } 3338 }
3339 3339
3340 void test_logicalAnd_null_false() { 3340 void test_logicalAnd_null_false() {
3341 try { 3341 try {
3342 _assertLogicalAnd(_boolValue(false), _nullValue(), _boolValue(false)); 3342 _assertLogicalAnd(_boolValue(false), _nullValue(), _boolValue(false));
3343 fail("Expected EvaluationException"); 3343 fail("Expected EvaluationException");
3344 } on EvaluationException catch (exception) {} 3344 } on EvaluationException {}
3345 } 3345 }
3346 3346
3347 void test_logicalAnd_null_true() { 3347 void test_logicalAnd_null_true() {
3348 try { 3348 try {
3349 _assertLogicalAnd(_boolValue(false), _nullValue(), _boolValue(true)); 3349 _assertLogicalAnd(_boolValue(false), _nullValue(), _boolValue(true));
3350 fail("Expected EvaluationException"); 3350 fail("Expected EvaluationException");
3351 } on EvaluationException catch (exception) {} 3351 } on EvaluationException {}
3352 } 3352 }
3353 3353
3354 void test_logicalAnd_string_false() { 3354 void test_logicalAnd_string_false() {
3355 try { 3355 try {
3356 _assertLogicalAnd( 3356 _assertLogicalAnd(
3357 _boolValue(false), _stringValue("true"), _boolValue(false)); 3357 _boolValue(false), _stringValue("true"), _boolValue(false));
3358 fail("Expected EvaluationException"); 3358 fail("Expected EvaluationException");
3359 } on EvaluationException catch (exception) {} 3359 } on EvaluationException {}
3360 } 3360 }
3361 3361
3362 void test_logicalAnd_string_true() { 3362 void test_logicalAnd_string_true() {
3363 try { 3363 try {
3364 _assertLogicalAnd( 3364 _assertLogicalAnd(
3365 _boolValue(false), _stringValue("false"), _boolValue(true)); 3365 _boolValue(false), _stringValue("false"), _boolValue(true));
3366 fail("Expected EvaluationException"); 3366 fail("Expected EvaluationException");
3367 } on EvaluationException catch (exception) {} 3367 } on EvaluationException {}
3368 } 3368 }
3369 3369
3370 void test_logicalAnd_true_false() { 3370 void test_logicalAnd_true_false() {
3371 _assertLogicalAnd(_boolValue(false), _boolValue(true), _boolValue(false)); 3371 _assertLogicalAnd(_boolValue(false), _boolValue(true), _boolValue(false));
3372 } 3372 }
3373 3373
3374 void test_logicalAnd_true_null() { 3374 void test_logicalAnd_true_null() {
3375 _assertLogicalAnd(null, _boolValue(true), _nullValue()); 3375 _assertLogicalAnd(null, _boolValue(true), _nullValue());
3376 } 3376 }
3377 3377
3378 void test_logicalAnd_true_string() { 3378 void test_logicalAnd_true_string() {
3379 try { 3379 try {
3380 _assertLogicalAnd( 3380 _assertLogicalAnd(
3381 _boolValue(false), _boolValue(true), _stringValue("true")); 3381 _boolValue(false), _boolValue(true), _stringValue("true"));
3382 fail("Expected EvaluationException"); 3382 fail("Expected EvaluationException");
3383 } on EvaluationException catch (exception) {} 3383 } on EvaluationException {}
3384 } 3384 }
3385 3385
3386 void test_logicalAnd_true_true() { 3386 void test_logicalAnd_true_true() {
3387 _assertLogicalAnd(_boolValue(true), _boolValue(true), _boolValue(true)); 3387 _assertLogicalAnd(_boolValue(true), _boolValue(true), _boolValue(true));
3388 } 3388 }
3389 3389
3390 void test_logicalNot_false() { 3390 void test_logicalNot_false() {
3391 _assertLogicalNot(_boolValue(true), _boolValue(false)); 3391 _assertLogicalNot(_boolValue(true), _boolValue(false));
3392 } 3392 }
3393 3393
3394 void test_logicalNot_null() { 3394 void test_logicalNot_null() {
3395 _assertLogicalNot(null, _nullValue()); 3395 _assertLogicalNot(null, _nullValue());
3396 } 3396 }
3397 3397
3398 void test_logicalNot_string() { 3398 void test_logicalNot_string() {
3399 try { 3399 try {
3400 _assertLogicalNot(_boolValue(true), _stringValue(null)); 3400 _assertLogicalNot(_boolValue(true), _stringValue(null));
3401 fail("Expected EvaluationException"); 3401 fail("Expected EvaluationException");
3402 } on EvaluationException catch (exception) {} 3402 } on EvaluationException {}
3403 } 3403 }
3404 3404
3405 void test_logicalNot_true() { 3405 void test_logicalNot_true() {
3406 _assertLogicalNot(_boolValue(false), _boolValue(true)); 3406 _assertLogicalNot(_boolValue(false), _boolValue(true));
3407 } 3407 }
3408 3408
3409 void test_logicalNot_unknown() { 3409 void test_logicalNot_unknown() {
3410 _assertLogicalNot(_boolValue(null), _boolValue(null)); 3410 _assertLogicalNot(_boolValue(null), _boolValue(null));
3411 } 3411 }
3412 3412
3413 void test_logicalOr_false_false() { 3413 void test_logicalOr_false_false() {
3414 _assertLogicalOr(_boolValue(false), _boolValue(false), _boolValue(false)); 3414 _assertLogicalOr(_boolValue(false), _boolValue(false), _boolValue(false));
3415 } 3415 }
3416 3416
3417 void test_logicalOr_false_null() { 3417 void test_logicalOr_false_null() {
3418 _assertLogicalOr(null, _boolValue(false), _nullValue()); 3418 _assertLogicalOr(null, _boolValue(false), _nullValue());
3419 } 3419 }
3420 3420
3421 void test_logicalOr_false_string() { 3421 void test_logicalOr_false_string() {
3422 try { 3422 try {
3423 _assertLogicalOr( 3423 _assertLogicalOr(
3424 _boolValue(false), _boolValue(false), _stringValue("false")); 3424 _boolValue(false), _boolValue(false), _stringValue("false"));
3425 fail("Expected EvaluationException"); 3425 fail("Expected EvaluationException");
3426 } on EvaluationException catch (exception) {} 3426 } on EvaluationException {}
3427 } 3427 }
3428 3428
3429 void test_logicalOr_false_true() { 3429 void test_logicalOr_false_true() {
3430 _assertLogicalOr(_boolValue(true), _boolValue(false), _boolValue(true)); 3430 _assertLogicalOr(_boolValue(true), _boolValue(false), _boolValue(true));
3431 } 3431 }
3432 3432
3433 void test_logicalOr_null_false() { 3433 void test_logicalOr_null_false() {
3434 try { 3434 try {
3435 _assertLogicalOr(_boolValue(false), _nullValue(), _boolValue(false)); 3435 _assertLogicalOr(_boolValue(false), _nullValue(), _boolValue(false));
3436 fail("Expected EvaluationException"); 3436 fail("Expected EvaluationException");
3437 } on EvaluationException catch (exception) {} 3437 } on EvaluationException {}
3438 } 3438 }
3439 3439
3440 void test_logicalOr_null_true() { 3440 void test_logicalOr_null_true() {
3441 try { 3441 try {
3442 _assertLogicalOr(_boolValue(true), _nullValue(), _boolValue(true)); 3442 _assertLogicalOr(_boolValue(true), _nullValue(), _boolValue(true));
3443 fail("Expected EvaluationException"); 3443 fail("Expected EvaluationException");
3444 } on EvaluationException catch (exception) {} 3444 } on EvaluationException {}
3445 } 3445 }
3446 3446
3447 void test_logicalOr_string_false() { 3447 void test_logicalOr_string_false() {
3448 try { 3448 try {
3449 _assertLogicalOr( 3449 _assertLogicalOr(
3450 _boolValue(false), _stringValue("true"), _boolValue(false)); 3450 _boolValue(false), _stringValue("true"), _boolValue(false));
3451 fail("Expected EvaluationException"); 3451 fail("Expected EvaluationException");
3452 } on EvaluationException catch (exception) {} 3452 } on EvaluationException {}
3453 } 3453 }
3454 3454
3455 void test_logicalOr_string_true() { 3455 void test_logicalOr_string_true() {
3456 try { 3456 try {
3457 _assertLogicalOr( 3457 _assertLogicalOr(
3458 _boolValue(true), _stringValue("false"), _boolValue(true)); 3458 _boolValue(true), _stringValue("false"), _boolValue(true));
3459 fail("Expected EvaluationException"); 3459 fail("Expected EvaluationException");
3460 } on EvaluationException catch (exception) {} 3460 } on EvaluationException {}
3461 } 3461 }
3462 3462
3463 void test_logicalOr_true_false() { 3463 void test_logicalOr_true_false() {
3464 _assertLogicalOr(_boolValue(true), _boolValue(true), _boolValue(false)); 3464 _assertLogicalOr(_boolValue(true), _boolValue(true), _boolValue(false));
3465 } 3465 }
3466 3466
3467 void test_logicalOr_true_null() { 3467 void test_logicalOr_true_null() {
3468 try { 3468 try {
3469 _assertLogicalOr(_boolValue(true), _boolValue(true), _nullValue()); 3469 _assertLogicalOr(_boolValue(true), _boolValue(true), _nullValue());
3470 fail("Expected EvaluationException"); 3470 fail("Expected EvaluationException");
3471 } on EvaluationException catch (exception) {} 3471 } on EvaluationException {}
3472 } 3472 }
3473 3473
3474 void test_logicalOr_true_string() { 3474 void test_logicalOr_true_string() {
3475 try { 3475 try {
3476 _assertLogicalOr( 3476 _assertLogicalOr(
3477 _boolValue(true), _boolValue(true), _stringValue("true")); 3477 _boolValue(true), _boolValue(true), _stringValue("true"));
3478 fail("Expected EvaluationException"); 3478 fail("Expected EvaluationException");
3479 } on EvaluationException catch (exception) {} 3479 } on EvaluationException {}
3480 } 3480 }
3481 3481
3482 void test_logicalOr_true_true() { 3482 void test_logicalOr_true_true() {
3483 _assertLogicalOr(_boolValue(true), _boolValue(true), _boolValue(true)); 3483 _assertLogicalOr(_boolValue(true), _boolValue(true), _boolValue(true));
3484 } 3484 }
3485 3485
3486 void test_minus_knownDouble_knownDouble() { 3486 void test_minus_knownDouble_knownDouble() {
3487 _assertMinus(_doubleValue(1.0), _doubleValue(4.0), _doubleValue(3.0)); 3487 _assertMinus(_doubleValue(1.0), _doubleValue(4.0), _doubleValue(3.0));
3488 } 3488 }
3489 3489
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
3755 } 3755 }
3756 3756
3757 void test_shiftRight_unknownInt_unknownInt() { 3757 void test_shiftRight_unknownInt_unknownInt() {
3758 _assertShiftRight(_intValue(null), _intValue(null), _intValue(null)); 3758 _assertShiftRight(_intValue(null), _intValue(null), _intValue(null));
3759 } 3759 }
3760 3760
3761 void test_stringLength_int() { 3761 void test_stringLength_int() {
3762 try { 3762 try {
3763 _assertStringLength(_intValue(null), _intValue(0)); 3763 _assertStringLength(_intValue(null), _intValue(0));
3764 fail("Expected EvaluationException"); 3764 fail("Expected EvaluationException");
3765 } on EvaluationException catch (exception) {} 3765 } on EvaluationException {}
3766 } 3766 }
3767 3767
3768 void test_stringLength_knownString() { 3768 void test_stringLength_knownString() {
3769 _assertStringLength(_intValue(3), _stringValue("abc")); 3769 _assertStringLength(_intValue(3), _stringValue("abc"));
3770 } 3770 }
3771 3771
3772 void test_stringLength_unknownString() { 3772 void test_stringLength_unknownString() {
3773 _assertStringLength(_intValue(null), _stringValue(null)); 3773 _assertStringLength(_intValue(null), _stringValue(null));
3774 } 3774 }
3775 3775
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3833 * @param leftOperand the left operand to the operation 3833 * @param leftOperand the left operand to the operation
3834 * @param rightOperand the left operand to the operation 3834 * @param rightOperand the left operand to the operation
3835 * @throws EvaluationException if the result is an exception when it should no t be 3835 * @throws EvaluationException if the result is an exception when it should no t be
3836 */ 3836 */
3837 void _assertAdd(DartObjectImpl expected, DartObjectImpl leftOperand, 3837 void _assertAdd(DartObjectImpl expected, DartObjectImpl leftOperand,
3838 DartObjectImpl rightOperand) { 3838 DartObjectImpl rightOperand) {
3839 if (expected == null) { 3839 if (expected == null) {
3840 try { 3840 try {
3841 leftOperand.add(_typeProvider, rightOperand); 3841 leftOperand.add(_typeProvider, rightOperand);
3842 fail("Expected an EvaluationException"); 3842 fail("Expected an EvaluationException");
3843 } on EvaluationException catch (exception) {} 3843 } on EvaluationException {}
3844 } else { 3844 } else {
3845 DartObjectImpl result = leftOperand.add(_typeProvider, rightOperand); 3845 DartObjectImpl result = leftOperand.add(_typeProvider, rightOperand);
3846 expect(result, isNotNull); 3846 expect(result, isNotNull);
3847 expect(result, expected); 3847 expect(result, expected);
3848 } 3848 }
3849 } 3849 }
3850 3850
3851 /** 3851 /**
3852 * Assert that the result of bit-anding the left and right operands is the exp ected value, or that 3852 * Assert that the result of bit-anding the left and right operands is the exp ected value, or that
3853 * the operation throws an exception if the expected value is `null`. 3853 * the operation throws an exception if the expected value is `null`.
3854 * 3854 *
3855 * @param expected the expected result of the operation 3855 * @param expected the expected result of the operation
3856 * @param leftOperand the left operand to the operation 3856 * @param leftOperand the left operand to the operation
3857 * @param rightOperand the left operand to the operation 3857 * @param rightOperand the left operand to the operation
3858 * @throws EvaluationException if the result is an exception when it should no t be 3858 * @throws EvaluationException if the result is an exception when it should no t be
3859 */ 3859 */
3860 void _assertBitAnd(DartObjectImpl expected, DartObjectImpl leftOperand, 3860 void _assertBitAnd(DartObjectImpl expected, DartObjectImpl leftOperand,
3861 DartObjectImpl rightOperand) { 3861 DartObjectImpl rightOperand) {
3862 if (expected == null) { 3862 if (expected == null) {
3863 try { 3863 try {
3864 leftOperand.bitAnd(_typeProvider, rightOperand); 3864 leftOperand.bitAnd(_typeProvider, rightOperand);
3865 fail("Expected an EvaluationException"); 3865 fail("Expected an EvaluationException");
3866 } on EvaluationException catch (exception) {} 3866 } on EvaluationException {}
3867 } else { 3867 } else {
3868 DartObjectImpl result = leftOperand.bitAnd(_typeProvider, rightOperand); 3868 DartObjectImpl result = leftOperand.bitAnd(_typeProvider, rightOperand);
3869 expect(result, isNotNull); 3869 expect(result, isNotNull);
3870 expect(result, expected); 3870 expect(result, expected);
3871 } 3871 }
3872 } 3872 }
3873 3873
3874 /** 3874 /**
3875 * Assert that the bit-not of the operand is the expected value, or that the o peration throws an 3875 * Assert that the bit-not of the operand is the expected value, or that the o peration throws an
3876 * exception if the expected value is `null`. 3876 * exception if the expected value is `null`.
3877 * 3877 *
3878 * @param expected the expected result of the operation 3878 * @param expected the expected result of the operation
3879 * @param operand the operand to the operation 3879 * @param operand the operand to the operation
3880 * @throws EvaluationException if the result is an exception when it should no t be 3880 * @throws EvaluationException if the result is an exception when it should no t be
3881 */ 3881 */
3882 void _assertBitNot(DartObjectImpl expected, DartObjectImpl operand) { 3882 void _assertBitNot(DartObjectImpl expected, DartObjectImpl operand) {
3883 if (expected == null) { 3883 if (expected == null) {
3884 try { 3884 try {
3885 operand.bitNot(_typeProvider); 3885 operand.bitNot(_typeProvider);
3886 fail("Expected an EvaluationException"); 3886 fail("Expected an EvaluationException");
3887 } on EvaluationException catch (exception) {} 3887 } on EvaluationException {}
3888 } else { 3888 } else {
3889 DartObjectImpl result = operand.bitNot(_typeProvider); 3889 DartObjectImpl result = operand.bitNot(_typeProvider);
3890 expect(result, isNotNull); 3890 expect(result, isNotNull);
3891 expect(result, expected); 3891 expect(result, expected);
3892 } 3892 }
3893 } 3893 }
3894 3894
3895 /** 3895 /**
3896 * Assert that the result of bit-oring the left and right operands is the expe cted value, or that 3896 * Assert that the result of bit-oring the left and right operands is the expe cted value, or that
3897 * the operation throws an exception if the expected value is `null`. 3897 * the operation throws an exception if the expected value is `null`.
3898 * 3898 *
3899 * @param expected the expected result of the operation 3899 * @param expected the expected result of the operation
3900 * @param leftOperand the left operand to the operation 3900 * @param leftOperand the left operand to the operation
3901 * @param rightOperand the left operand to the operation 3901 * @param rightOperand the left operand to the operation
3902 * @throws EvaluationException if the result is an exception when it should no t be 3902 * @throws EvaluationException if the result is an exception when it should no t be
3903 */ 3903 */
3904 void _assertBitOr(DartObjectImpl expected, DartObjectImpl leftOperand, 3904 void _assertBitOr(DartObjectImpl expected, DartObjectImpl leftOperand,
3905 DartObjectImpl rightOperand) { 3905 DartObjectImpl rightOperand) {
3906 if (expected == null) { 3906 if (expected == null) {
3907 try { 3907 try {
3908 leftOperand.bitOr(_typeProvider, rightOperand); 3908 leftOperand.bitOr(_typeProvider, rightOperand);
3909 fail("Expected an EvaluationException"); 3909 fail("Expected an EvaluationException");
3910 } on EvaluationException catch (exception) {} 3910 } on EvaluationException {}
3911 } else { 3911 } else {
3912 DartObjectImpl result = leftOperand.bitOr(_typeProvider, rightOperand); 3912 DartObjectImpl result = leftOperand.bitOr(_typeProvider, rightOperand);
3913 expect(result, isNotNull); 3913 expect(result, isNotNull);
3914 expect(result, expected); 3914 expect(result, expected);
3915 } 3915 }
3916 } 3916 }
3917 3917
3918 /** 3918 /**
3919 * Assert that the result of bit-xoring the left and right operands is the exp ected value, or that 3919 * Assert that the result of bit-xoring the left and right operands is the exp ected value, or that
3920 * the operation throws an exception if the expected value is `null`. 3920 * the operation throws an exception if the expected value is `null`.
3921 * 3921 *
3922 * @param expected the expected result of the operation 3922 * @param expected the expected result of the operation
3923 * @param leftOperand the left operand to the operation 3923 * @param leftOperand the left operand to the operation
3924 * @param rightOperand the left operand to the operation 3924 * @param rightOperand the left operand to the operation
3925 * @throws EvaluationException if the result is an exception when it should no t be 3925 * @throws EvaluationException if the result is an exception when it should no t be
3926 */ 3926 */
3927 void _assertBitXor(DartObjectImpl expected, DartObjectImpl leftOperand, 3927 void _assertBitXor(DartObjectImpl expected, DartObjectImpl leftOperand,
3928 DartObjectImpl rightOperand) { 3928 DartObjectImpl rightOperand) {
3929 if (expected == null) { 3929 if (expected == null) {
3930 try { 3930 try {
3931 leftOperand.bitXor(_typeProvider, rightOperand); 3931 leftOperand.bitXor(_typeProvider, rightOperand);
3932 fail("Expected an EvaluationException"); 3932 fail("Expected an EvaluationException");
3933 } on EvaluationException catch (exception) {} 3933 } on EvaluationException {}
3934 } else { 3934 } else {
3935 DartObjectImpl result = leftOperand.bitXor(_typeProvider, rightOperand); 3935 DartObjectImpl result = leftOperand.bitXor(_typeProvider, rightOperand);
3936 expect(result, isNotNull); 3936 expect(result, isNotNull);
3937 expect(result, expected); 3937 expect(result, expected);
3938 } 3938 }
3939 } 3939 }
3940 3940
3941 /** 3941 /**
3942 * Assert that the result of concatenating the left and right operands is the expected value, or 3942 * Assert that the result of concatenating the left and right operands is the expected value, or
3943 * that the operation throws an exception if the expected value is `null`. 3943 * that the operation throws an exception if the expected value is `null`.
3944 * 3944 *
3945 * @param expected the expected result of the operation 3945 * @param expected the expected result of the operation
3946 * @param leftOperand the left operand to the operation 3946 * @param leftOperand the left operand to the operation
3947 * @param rightOperand the left operand to the operation 3947 * @param rightOperand the left operand to the operation
3948 * @throws EvaluationException if the result is an exception when it should no t be 3948 * @throws EvaluationException if the result is an exception when it should no t be
3949 */ 3949 */
3950 void _assertConcatenate(DartObjectImpl expected, DartObjectImpl leftOperand, 3950 void _assertConcatenate(DartObjectImpl expected, DartObjectImpl leftOperand,
3951 DartObjectImpl rightOperand) { 3951 DartObjectImpl rightOperand) {
3952 if (expected == null) { 3952 if (expected == null) {
3953 try { 3953 try {
3954 leftOperand.concatenate(_typeProvider, rightOperand); 3954 leftOperand.concatenate(_typeProvider, rightOperand);
3955 fail("Expected an EvaluationException"); 3955 fail("Expected an EvaluationException");
3956 } on EvaluationException catch (exception) {} 3956 } on EvaluationException {}
3957 } else { 3957 } else {
3958 DartObjectImpl result = 3958 DartObjectImpl result =
3959 leftOperand.concatenate(_typeProvider, rightOperand); 3959 leftOperand.concatenate(_typeProvider, rightOperand);
3960 expect(result, isNotNull); 3960 expect(result, isNotNull);
3961 expect(result, expected); 3961 expect(result, expected);
3962 } 3962 }
3963 } 3963 }
3964 3964
3965 /** 3965 /**
3966 * Assert that the result of dividing the left and right operands is the expec ted value, or that 3966 * Assert that the result of dividing the left and right operands is the expec ted value, or that
3967 * the operation throws an exception if the expected value is `null`. 3967 * the operation throws an exception if the expected value is `null`.
3968 * 3968 *
3969 * @param expected the expected result of the operation 3969 * @param expected the expected result of the operation
3970 * @param leftOperand the left operand to the operation 3970 * @param leftOperand the left operand to the operation
3971 * @param rightOperand the left operand to the operation 3971 * @param rightOperand the left operand to the operation
3972 * @throws EvaluationException if the result is an exception when it should no t be 3972 * @throws EvaluationException if the result is an exception when it should no t be
3973 */ 3973 */
3974 void _assertDivide(DartObjectImpl expected, DartObjectImpl leftOperand, 3974 void _assertDivide(DartObjectImpl expected, DartObjectImpl leftOperand,
3975 DartObjectImpl rightOperand) { 3975 DartObjectImpl rightOperand) {
3976 if (expected == null) { 3976 if (expected == null) {
3977 try { 3977 try {
3978 leftOperand.divide(_typeProvider, rightOperand); 3978 leftOperand.divide(_typeProvider, rightOperand);
3979 fail("Expected an EvaluationException"); 3979 fail("Expected an EvaluationException");
3980 } on EvaluationException catch (exception) {} 3980 } on EvaluationException {}
3981 } else { 3981 } else {
3982 DartObjectImpl result = leftOperand.divide(_typeProvider, rightOperand); 3982 DartObjectImpl result = leftOperand.divide(_typeProvider, rightOperand);
3983 expect(result, isNotNull); 3983 expect(result, isNotNull);
3984 expect(result, expected); 3984 expect(result, expected);
3985 } 3985 }
3986 } 3986 }
3987 3987
3988 /** 3988 /**
3989 * Assert that the result of comparing the left and right operands for equalit y is the expected 3989 * Assert that the result of comparing the left and right operands for equalit y is the expected
3990 * value, or that the operation throws an exception if the expected value is ` null`. 3990 * value, or that the operation throws an exception if the expected value is ` null`.
3991 * 3991 *
3992 * @param expected the expected result of the operation 3992 * @param expected the expected result of the operation
3993 * @param leftOperand the left operand to the operation 3993 * @param leftOperand the left operand to the operation
3994 * @param rightOperand the left operand to the operation 3994 * @param rightOperand the left operand to the operation
3995 * @throws EvaluationException if the result is an exception when it should no t be 3995 * @throws EvaluationException if the result is an exception when it should no t be
3996 */ 3996 */
3997 void _assertEqualEqual(DartObjectImpl expected, DartObjectImpl leftOperand, 3997 void _assertEqualEqual(DartObjectImpl expected, DartObjectImpl leftOperand,
3998 DartObjectImpl rightOperand) { 3998 DartObjectImpl rightOperand) {
3999 if (expected == null) { 3999 if (expected == null) {
4000 try { 4000 try {
4001 leftOperand.equalEqual(_typeProvider, rightOperand); 4001 leftOperand.equalEqual(_typeProvider, rightOperand);
4002 fail("Expected an EvaluationException"); 4002 fail("Expected an EvaluationException");
4003 } on EvaluationException catch (exception) {} 4003 } on EvaluationException {}
4004 } else { 4004 } else {
4005 DartObjectImpl result = 4005 DartObjectImpl result =
4006 leftOperand.equalEqual(_typeProvider, rightOperand); 4006 leftOperand.equalEqual(_typeProvider, rightOperand);
4007 expect(result, isNotNull); 4007 expect(result, isNotNull);
4008 expect(result, expected); 4008 expect(result, expected);
4009 } 4009 }
4010 } 4010 }
4011 4011
4012 /** 4012 /**
4013 * Assert that the result of comparing the left and right operands is the expe cted value, or that 4013 * Assert that the result of comparing the left and right operands is the expe cted value, or that
4014 * the operation throws an exception if the expected value is `null`. 4014 * the operation throws an exception if the expected value is `null`.
4015 * 4015 *
4016 * @param expected the expected result of the operation 4016 * @param expected the expected result of the operation
4017 * @param leftOperand the left operand to the operation 4017 * @param leftOperand the left operand to the operation
4018 * @param rightOperand the left operand to the operation 4018 * @param rightOperand the left operand to the operation
4019 * @throws EvaluationException if the result is an exception when it should no t be 4019 * @throws EvaluationException if the result is an exception when it should no t be
4020 */ 4020 */
4021 void _assertGreaterThan(DartObjectImpl expected, DartObjectImpl leftOperand, 4021 void _assertGreaterThan(DartObjectImpl expected, DartObjectImpl leftOperand,
4022 DartObjectImpl rightOperand) { 4022 DartObjectImpl rightOperand) {
4023 if (expected == null) { 4023 if (expected == null) {
4024 try { 4024 try {
4025 leftOperand.greaterThan(_typeProvider, rightOperand); 4025 leftOperand.greaterThan(_typeProvider, rightOperand);
4026 fail("Expected an EvaluationException"); 4026 fail("Expected an EvaluationException");
4027 } on EvaluationException catch (exception) {} 4027 } on EvaluationException {}
4028 } else { 4028 } else {
4029 DartObjectImpl result = 4029 DartObjectImpl result =
4030 leftOperand.greaterThan(_typeProvider, rightOperand); 4030 leftOperand.greaterThan(_typeProvider, rightOperand);
4031 expect(result, isNotNull); 4031 expect(result, isNotNull);
4032 expect(result, expected); 4032 expect(result, expected);
4033 } 4033 }
4034 } 4034 }
4035 4035
4036 /** 4036 /**
4037 * Assert that the result of comparing the left and right operands is the expe cted value, or that 4037 * Assert that the result of comparing the left and right operands is the expe cted value, or that
4038 * the operation throws an exception if the expected value is `null`. 4038 * the operation throws an exception if the expected value is `null`.
4039 * 4039 *
4040 * @param expected the expected result of the operation 4040 * @param expected the expected result of the operation
4041 * @param leftOperand the left operand to the operation 4041 * @param leftOperand the left operand to the operation
4042 * @param rightOperand the left operand to the operation 4042 * @param rightOperand the left operand to the operation
4043 * @throws EvaluationException if the result is an exception when it should no t be 4043 * @throws EvaluationException if the result is an exception when it should no t be
4044 */ 4044 */
4045 void _assertGreaterThanOrEqual(DartObjectImpl expected, 4045 void _assertGreaterThanOrEqual(DartObjectImpl expected,
4046 DartObjectImpl leftOperand, DartObjectImpl rightOperand) { 4046 DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
4047 if (expected == null) { 4047 if (expected == null) {
4048 try { 4048 try {
4049 leftOperand.greaterThanOrEqual(_typeProvider, rightOperand); 4049 leftOperand.greaterThanOrEqual(_typeProvider, rightOperand);
4050 fail("Expected an EvaluationException"); 4050 fail("Expected an EvaluationException");
4051 } on EvaluationException catch (exception) {} 4051 } on EvaluationException {}
4052 } else { 4052 } else {
4053 DartObjectImpl result = 4053 DartObjectImpl result =
4054 leftOperand.greaterThanOrEqual(_typeProvider, rightOperand); 4054 leftOperand.greaterThanOrEqual(_typeProvider, rightOperand);
4055 expect(result, isNotNull); 4055 expect(result, isNotNull);
4056 expect(result, expected); 4056 expect(result, expected);
4057 } 4057 }
4058 } 4058 }
4059 4059
4060 /** 4060 /**
4061 * Assert that the result of comparing the left and right operands using 4061 * Assert that the result of comparing the left and right operands using
(...skipping 23 matching lines...) Expand all
4085 * @param leftOperand the left operand to the operation 4085 * @param leftOperand the left operand to the operation
4086 * @param rightOperand the left operand to the operation 4086 * @param rightOperand the left operand to the operation
4087 * @throws EvaluationException if the result is an exception when it should no t be 4087 * @throws EvaluationException if the result is an exception when it should no t be
4088 */ 4088 */
4089 void _assertIntegerDivide(DartObjectImpl expected, DartObjectImpl leftOperand, 4089 void _assertIntegerDivide(DartObjectImpl expected, DartObjectImpl leftOperand,
4090 DartObjectImpl rightOperand) { 4090 DartObjectImpl rightOperand) {
4091 if (expected == null) { 4091 if (expected == null) {
4092 try { 4092 try {
4093 leftOperand.integerDivide(_typeProvider, rightOperand); 4093 leftOperand.integerDivide(_typeProvider, rightOperand);
4094 fail("Expected an EvaluationException"); 4094 fail("Expected an EvaluationException");
4095 } on EvaluationException catch (exception) {} 4095 } on EvaluationException {}
4096 } else { 4096 } else {
4097 DartObjectImpl result = 4097 DartObjectImpl result =
4098 leftOperand.integerDivide(_typeProvider, rightOperand); 4098 leftOperand.integerDivide(_typeProvider, rightOperand);
4099 expect(result, isNotNull); 4099 expect(result, isNotNull);
4100 expect(result, expected); 4100 expect(result, expected);
4101 } 4101 }
4102 } 4102 }
4103 4103
4104 /** 4104 /**
4105 * Assert that the result of comparing the left and right operands is the expe cted value, or that 4105 * Assert that the result of comparing the left and right operands is the expe cted value, or that
4106 * the operation throws an exception if the expected value is `null`. 4106 * the operation throws an exception if the expected value is `null`.
4107 * 4107 *
4108 * @param expected the expected result of the operation 4108 * @param expected the expected result of the operation
4109 * @param leftOperand the left operand to the operation 4109 * @param leftOperand the left operand to the operation
4110 * @param rightOperand the left operand to the operation 4110 * @param rightOperand the left operand to the operation
4111 * @throws EvaluationException if the result is an exception when it should no t be 4111 * @throws EvaluationException if the result is an exception when it should no t be
4112 */ 4112 */
4113 void _assertLessThan(DartObjectImpl expected, DartObjectImpl leftOperand, 4113 void _assertLessThan(DartObjectImpl expected, DartObjectImpl leftOperand,
4114 DartObjectImpl rightOperand) { 4114 DartObjectImpl rightOperand) {
4115 if (expected == null) { 4115 if (expected == null) {
4116 try { 4116 try {
4117 leftOperand.lessThan(_typeProvider, rightOperand); 4117 leftOperand.lessThan(_typeProvider, rightOperand);
4118 fail("Expected an EvaluationException"); 4118 fail("Expected an EvaluationException");
4119 } on EvaluationException catch (exception) {} 4119 } on EvaluationException {}
4120 } else { 4120 } else {
4121 DartObjectImpl result = leftOperand.lessThan(_typeProvider, rightOperand); 4121 DartObjectImpl result = leftOperand.lessThan(_typeProvider, rightOperand);
4122 expect(result, isNotNull); 4122 expect(result, isNotNull);
4123 expect(result, expected); 4123 expect(result, expected);
4124 } 4124 }
4125 } 4125 }
4126 4126
4127 /** 4127 /**
4128 * Assert that the result of comparing the left and right operands is the expe cted value, or that 4128 * Assert that the result of comparing the left and right operands is the expe cted value, or that
4129 * the operation throws an exception if the expected value is `null`. 4129 * the operation throws an exception if the expected value is `null`.
4130 * 4130 *
4131 * @param expected the expected result of the operation 4131 * @param expected the expected result of the operation
4132 * @param leftOperand the left operand to the operation 4132 * @param leftOperand the left operand to the operation
4133 * @param rightOperand the left operand to the operation 4133 * @param rightOperand the left operand to the operation
4134 * @throws EvaluationException if the result is an exception when it should no t be 4134 * @throws EvaluationException if the result is an exception when it should no t be
4135 */ 4135 */
4136 void _assertLessThanOrEqual(DartObjectImpl expected, 4136 void _assertLessThanOrEqual(DartObjectImpl expected,
4137 DartObjectImpl leftOperand, DartObjectImpl rightOperand) { 4137 DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
4138 if (expected == null) { 4138 if (expected == null) {
4139 try { 4139 try {
4140 leftOperand.lessThanOrEqual(_typeProvider, rightOperand); 4140 leftOperand.lessThanOrEqual(_typeProvider, rightOperand);
4141 fail("Expected an EvaluationException"); 4141 fail("Expected an EvaluationException");
4142 } on EvaluationException catch (exception) {} 4142 } on EvaluationException {}
4143 } else { 4143 } else {
4144 DartObjectImpl result = 4144 DartObjectImpl result =
4145 leftOperand.lessThanOrEqual(_typeProvider, rightOperand); 4145 leftOperand.lessThanOrEqual(_typeProvider, rightOperand);
4146 expect(result, isNotNull); 4146 expect(result, isNotNull);
4147 expect(result, expected); 4147 expect(result, expected);
4148 } 4148 }
4149 } 4149 }
4150 4150
4151 /** 4151 /**
4152 * Assert that the result of logical-anding the left and right operands is the expected value, or 4152 * Assert that the result of logical-anding the left and right operands is the expected value, or
4153 * that the operation throws an exception if the expected value is `null`. 4153 * that the operation throws an exception if the expected value is `null`.
4154 * 4154 *
4155 * @param expected the expected result of the operation 4155 * @param expected the expected result of the operation
4156 * @param leftOperand the left operand to the operation 4156 * @param leftOperand the left operand to the operation
4157 * @param rightOperand the left operand to the operation 4157 * @param rightOperand the left operand to the operation
4158 * @throws EvaluationException if the result is an exception when it should no t be 4158 * @throws EvaluationException if the result is an exception when it should no t be
4159 */ 4159 */
4160 void _assertLogicalAnd(DartObjectImpl expected, DartObjectImpl leftOperand, 4160 void _assertLogicalAnd(DartObjectImpl expected, DartObjectImpl leftOperand,
4161 DartObjectImpl rightOperand) { 4161 DartObjectImpl rightOperand) {
4162 if (expected == null) { 4162 if (expected == null) {
4163 try { 4163 try {
4164 leftOperand.logicalAnd(_typeProvider, rightOperand); 4164 leftOperand.logicalAnd(_typeProvider, rightOperand);
4165 fail("Expected an EvaluationException"); 4165 fail("Expected an EvaluationException");
4166 } on EvaluationException catch (exception) {} 4166 } on EvaluationException {}
4167 } else { 4167 } else {
4168 DartObjectImpl result = 4168 DartObjectImpl result =
4169 leftOperand.logicalAnd(_typeProvider, rightOperand); 4169 leftOperand.logicalAnd(_typeProvider, rightOperand);
4170 expect(result, isNotNull); 4170 expect(result, isNotNull);
4171 expect(result, expected); 4171 expect(result, expected);
4172 } 4172 }
4173 } 4173 }
4174 4174
4175 /** 4175 /**
4176 * Assert that the logical-not of the operand is the expected value, or that t he operation throws 4176 * Assert that the logical-not of the operand is the expected value, or that t he operation throws
4177 * an exception if the expected value is `null`. 4177 * an exception if the expected value is `null`.
4178 * 4178 *
4179 * @param expected the expected result of the operation 4179 * @param expected the expected result of the operation
4180 * @param operand the operand to the operation 4180 * @param operand the operand to the operation
4181 * @throws EvaluationException if the result is an exception when it should no t be 4181 * @throws EvaluationException if the result is an exception when it should no t be
4182 */ 4182 */
4183 void _assertLogicalNot(DartObjectImpl expected, DartObjectImpl operand) { 4183 void _assertLogicalNot(DartObjectImpl expected, DartObjectImpl operand) {
4184 if (expected == null) { 4184 if (expected == null) {
4185 try { 4185 try {
4186 operand.logicalNot(_typeProvider); 4186 operand.logicalNot(_typeProvider);
4187 fail("Expected an EvaluationException"); 4187 fail("Expected an EvaluationException");
4188 } on EvaluationException catch (exception) {} 4188 } on EvaluationException {}
4189 } else { 4189 } else {
4190 DartObjectImpl result = operand.logicalNot(_typeProvider); 4190 DartObjectImpl result = operand.logicalNot(_typeProvider);
4191 expect(result, isNotNull); 4191 expect(result, isNotNull);
4192 expect(result, expected); 4192 expect(result, expected);
4193 } 4193 }
4194 } 4194 }
4195 4195
4196 /** 4196 /**
4197 * Assert that the result of logical-oring the left and right operands is the expected value, or 4197 * Assert that the result of logical-oring the left and right operands is the expected value, or
4198 * that the operation throws an exception if the expected value is `null`. 4198 * that the operation throws an exception if the expected value is `null`.
4199 * 4199 *
4200 * @param expected the expected result of the operation 4200 * @param expected the expected result of the operation
4201 * @param leftOperand the left operand to the operation 4201 * @param leftOperand the left operand to the operation
4202 * @param rightOperand the left operand to the operation 4202 * @param rightOperand the left operand to the operation
4203 * @throws EvaluationException if the result is an exception when it should no t be 4203 * @throws EvaluationException if the result is an exception when it should no t be
4204 */ 4204 */
4205 void _assertLogicalOr(DartObjectImpl expected, DartObjectImpl leftOperand, 4205 void _assertLogicalOr(DartObjectImpl expected, DartObjectImpl leftOperand,
4206 DartObjectImpl rightOperand) { 4206 DartObjectImpl rightOperand) {
4207 if (expected == null) { 4207 if (expected == null) {
4208 try { 4208 try {
4209 leftOperand.logicalOr(_typeProvider, rightOperand); 4209 leftOperand.logicalOr(_typeProvider, rightOperand);
4210 fail("Expected an EvaluationException"); 4210 fail("Expected an EvaluationException");
4211 } on EvaluationException catch (exception) {} 4211 } on EvaluationException {}
4212 } else { 4212 } else {
4213 DartObjectImpl result = 4213 DartObjectImpl result =
4214 leftOperand.logicalOr(_typeProvider, rightOperand); 4214 leftOperand.logicalOr(_typeProvider, rightOperand);
4215 expect(result, isNotNull); 4215 expect(result, isNotNull);
4216 expect(result, expected); 4216 expect(result, expected);
4217 } 4217 }
4218 } 4218 }
4219 4219
4220 /** 4220 /**
4221 * Assert that the result of subtracting the left and right operands is the ex pected value, or 4221 * Assert that the result of subtracting the left and right operands is the ex pected value, or
4222 * that the operation throws an exception if the expected value is `null`. 4222 * that the operation throws an exception if the expected value is `null`.
4223 * 4223 *
4224 * @param expected the expected result of the operation 4224 * @param expected the expected result of the operation
4225 * @param leftOperand the left operand to the operation 4225 * @param leftOperand the left operand to the operation
4226 * @param rightOperand the left operand to the operation 4226 * @param rightOperand the left operand to the operation
4227 * @throws EvaluationException if the result is an exception when it should no t be 4227 * @throws EvaluationException if the result is an exception when it should no t be
4228 */ 4228 */
4229 void _assertMinus(DartObjectImpl expected, DartObjectImpl leftOperand, 4229 void _assertMinus(DartObjectImpl expected, DartObjectImpl leftOperand,
4230 DartObjectImpl rightOperand) { 4230 DartObjectImpl rightOperand) {
4231 if (expected == null) { 4231 if (expected == null) {
4232 try { 4232 try {
4233 leftOperand.minus(_typeProvider, rightOperand); 4233 leftOperand.minus(_typeProvider, rightOperand);
4234 fail("Expected an EvaluationException"); 4234 fail("Expected an EvaluationException");
4235 } on EvaluationException catch (exception) {} 4235 } on EvaluationException {}
4236 } else { 4236 } else {
4237 DartObjectImpl result = leftOperand.minus(_typeProvider, rightOperand); 4237 DartObjectImpl result = leftOperand.minus(_typeProvider, rightOperand);
4238 expect(result, isNotNull); 4238 expect(result, isNotNull);
4239 expect(result, expected); 4239 expect(result, expected);
4240 } 4240 }
4241 } 4241 }
4242 4242
4243 /** 4243 /**
4244 * Assert that the negation of the operand is the expected value, or that the operation throws an 4244 * Assert that the negation of the operand is the expected value, or that the operation throws an
4245 * exception if the expected value is `null`. 4245 * exception if the expected value is `null`.
4246 * 4246 *
4247 * @param expected the expected result of the operation 4247 * @param expected the expected result of the operation
4248 * @param operand the operand to the operation 4248 * @param operand the operand to the operation
4249 * @throws EvaluationException if the result is an exception when it should no t be 4249 * @throws EvaluationException if the result is an exception when it should no t be
4250 */ 4250 */
4251 void _assertNegated(DartObjectImpl expected, DartObjectImpl operand) { 4251 void _assertNegated(DartObjectImpl expected, DartObjectImpl operand) {
4252 if (expected == null) { 4252 if (expected == null) {
4253 try { 4253 try {
4254 operand.negated(_typeProvider); 4254 operand.negated(_typeProvider);
4255 fail("Expected an EvaluationException"); 4255 fail("Expected an EvaluationException");
4256 } on EvaluationException catch (exception) {} 4256 } on EvaluationException {}
4257 } else { 4257 } else {
4258 DartObjectImpl result = operand.negated(_typeProvider); 4258 DartObjectImpl result = operand.negated(_typeProvider);
4259 expect(result, isNotNull); 4259 expect(result, isNotNull);
4260 expect(result, expected); 4260 expect(result, expected);
4261 } 4261 }
4262 } 4262 }
4263 4263
4264 /** 4264 /**
4265 * Assert that the result of comparing the left and right operands for inequal ity is the expected 4265 * Assert that the result of comparing the left and right operands for inequal ity is the expected
4266 * value, or that the operation throws an exception if the expected value is ` null`. 4266 * value, or that the operation throws an exception if the expected value is ` null`.
4267 * 4267 *
4268 * @param expected the expected result of the operation 4268 * @param expected the expected result of the operation
4269 * @param leftOperand the left operand to the operation 4269 * @param leftOperand the left operand to the operation
4270 * @param rightOperand the left operand to the operation 4270 * @param rightOperand the left operand to the operation
4271 * @throws EvaluationException if the result is an exception when it should no t be 4271 * @throws EvaluationException if the result is an exception when it should no t be
4272 */ 4272 */
4273 void _assertNotEqual(DartObjectImpl expected, DartObjectImpl leftOperand, 4273 void _assertNotEqual(DartObjectImpl expected, DartObjectImpl leftOperand,
4274 DartObjectImpl rightOperand) { 4274 DartObjectImpl rightOperand) {
4275 if (expected == null) { 4275 if (expected == null) {
4276 try { 4276 try {
4277 leftOperand.notEqual(_typeProvider, rightOperand); 4277 leftOperand.notEqual(_typeProvider, rightOperand);
4278 fail("Expected an EvaluationException"); 4278 fail("Expected an EvaluationException");
4279 } on EvaluationException catch (exception) {} 4279 } on EvaluationException {}
4280 } else { 4280 } else {
4281 DartObjectImpl result = leftOperand.notEqual(_typeProvider, rightOperand); 4281 DartObjectImpl result = leftOperand.notEqual(_typeProvider, rightOperand);
4282 expect(result, isNotNull); 4282 expect(result, isNotNull);
4283 expect(result, expected); 4283 expect(result, expected);
4284 } 4284 }
4285 } 4285 }
4286 4286
4287 /** 4287 /**
4288 * Assert that converting the operand to a string is the expected value, or th at the operation 4288 * Assert that converting the operand to a string is the expected value, or th at the operation
4289 * throws an exception if the expected value is `null`. 4289 * throws an exception if the expected value is `null`.
4290 * 4290 *
4291 * @param expected the expected result of the operation 4291 * @param expected the expected result of the operation
4292 * @param operand the operand to the operation 4292 * @param operand the operand to the operation
4293 * @throws EvaluationException if the result is an exception when it should no t be 4293 * @throws EvaluationException if the result is an exception when it should no t be
4294 */ 4294 */
4295 void _assertPerformToString(DartObjectImpl expected, DartObjectImpl operand) { 4295 void _assertPerformToString(DartObjectImpl expected, DartObjectImpl operand) {
4296 if (expected == null) { 4296 if (expected == null) {
4297 try { 4297 try {
4298 operand.performToString(_typeProvider); 4298 operand.performToString(_typeProvider);
4299 fail("Expected an EvaluationException"); 4299 fail("Expected an EvaluationException");
4300 } on EvaluationException catch (exception) {} 4300 } on EvaluationException {}
4301 } else { 4301 } else {
4302 DartObjectImpl result = operand.performToString(_typeProvider); 4302 DartObjectImpl result = operand.performToString(_typeProvider);
4303 expect(result, isNotNull); 4303 expect(result, isNotNull);
4304 expect(result, expected); 4304 expect(result, expected);
4305 } 4305 }
4306 } 4306 }
4307 4307
4308 /** 4308 /**
4309 * Assert that the result of taking the remainder of the left and right operan ds is the expected 4309 * Assert that the result of taking the remainder of the left and right operan ds is the expected
4310 * value, or that the operation throws an exception if the expected value is ` null`. 4310 * value, or that the operation throws an exception if the expected value is ` null`.
4311 * 4311 *
4312 * @param expected the expected result of the operation 4312 * @param expected the expected result of the operation
4313 * @param leftOperand the left operand to the operation 4313 * @param leftOperand the left operand to the operation
4314 * @param rightOperand the left operand to the operation 4314 * @param rightOperand the left operand to the operation
4315 * @throws EvaluationException if the result is an exception when it should no t be 4315 * @throws EvaluationException if the result is an exception when it should no t be
4316 */ 4316 */
4317 void _assertRemainder(DartObjectImpl expected, DartObjectImpl leftOperand, 4317 void _assertRemainder(DartObjectImpl expected, DartObjectImpl leftOperand,
4318 DartObjectImpl rightOperand) { 4318 DartObjectImpl rightOperand) {
4319 if (expected == null) { 4319 if (expected == null) {
4320 try { 4320 try {
4321 leftOperand.remainder(_typeProvider, rightOperand); 4321 leftOperand.remainder(_typeProvider, rightOperand);
4322 fail("Expected an EvaluationException"); 4322 fail("Expected an EvaluationException");
4323 } on EvaluationException catch (exception) {} 4323 } on EvaluationException {}
4324 } else { 4324 } else {
4325 DartObjectImpl result = 4325 DartObjectImpl result =
4326 leftOperand.remainder(_typeProvider, rightOperand); 4326 leftOperand.remainder(_typeProvider, rightOperand);
4327 expect(result, isNotNull); 4327 expect(result, isNotNull);
4328 expect(result, expected); 4328 expect(result, expected);
4329 } 4329 }
4330 } 4330 }
4331 4331
4332 /** 4332 /**
4333 * Assert that the result of multiplying the left and right operands is the ex pected value, or 4333 * Assert that the result of multiplying the left and right operands is the ex pected value, or
4334 * that the operation throws an exception if the expected value is `null`. 4334 * that the operation throws an exception if the expected value is `null`.
4335 * 4335 *
4336 * @param expected the expected result of the operation 4336 * @param expected the expected result of the operation
4337 * @param leftOperand the left operand to the operation 4337 * @param leftOperand the left operand to the operation
4338 * @param rightOperand the left operand to the operation 4338 * @param rightOperand the left operand to the operation
4339 * @throws EvaluationException if the result is an exception when it should no t be 4339 * @throws EvaluationException if the result is an exception when it should no t be
4340 */ 4340 */
4341 void _assertShiftLeft(DartObjectImpl expected, DartObjectImpl leftOperand, 4341 void _assertShiftLeft(DartObjectImpl expected, DartObjectImpl leftOperand,
4342 DartObjectImpl rightOperand) { 4342 DartObjectImpl rightOperand) {
4343 if (expected == null) { 4343 if (expected == null) {
4344 try { 4344 try {
4345 leftOperand.shiftLeft(_typeProvider, rightOperand); 4345 leftOperand.shiftLeft(_typeProvider, rightOperand);
4346 fail("Expected an EvaluationException"); 4346 fail("Expected an EvaluationException");
4347 } on EvaluationException catch (exception) {} 4347 } on EvaluationException {}
4348 } else { 4348 } else {
4349 DartObjectImpl result = 4349 DartObjectImpl result =
4350 leftOperand.shiftLeft(_typeProvider, rightOperand); 4350 leftOperand.shiftLeft(_typeProvider, rightOperand);
4351 expect(result, isNotNull); 4351 expect(result, isNotNull);
4352 expect(result, expected); 4352 expect(result, expected);
4353 } 4353 }
4354 } 4354 }
4355 4355
4356 /** 4356 /**
4357 * Assert that the result of multiplying the left and right operands is the ex pected value, or 4357 * Assert that the result of multiplying the left and right operands is the ex pected value, or
4358 * that the operation throws an exception if the expected value is `null`. 4358 * that the operation throws an exception if the expected value is `null`.
4359 * 4359 *
4360 * @param expected the expected result of the operation 4360 * @param expected the expected result of the operation
4361 * @param leftOperand the left operand to the operation 4361 * @param leftOperand the left operand to the operation
4362 * @param rightOperand the left operand to the operation 4362 * @param rightOperand the left operand to the operation
4363 * @throws EvaluationException if the result is an exception when it should no t be 4363 * @throws EvaluationException if the result is an exception when it should no t be
4364 */ 4364 */
4365 void _assertShiftRight(DartObjectImpl expected, DartObjectImpl leftOperand, 4365 void _assertShiftRight(DartObjectImpl expected, DartObjectImpl leftOperand,
4366 DartObjectImpl rightOperand) { 4366 DartObjectImpl rightOperand) {
4367 if (expected == null) { 4367 if (expected == null) {
4368 try { 4368 try {
4369 leftOperand.shiftRight(_typeProvider, rightOperand); 4369 leftOperand.shiftRight(_typeProvider, rightOperand);
4370 fail("Expected an EvaluationException"); 4370 fail("Expected an EvaluationException");
4371 } on EvaluationException catch (exception) {} 4371 } on EvaluationException {}
4372 } else { 4372 } else {
4373 DartObjectImpl result = 4373 DartObjectImpl result =
4374 leftOperand.shiftRight(_typeProvider, rightOperand); 4374 leftOperand.shiftRight(_typeProvider, rightOperand);
4375 expect(result, isNotNull); 4375 expect(result, isNotNull);
4376 expect(result, expected); 4376 expect(result, expected);
4377 } 4377 }
4378 } 4378 }
4379 4379
4380 /** 4380 /**
4381 * Assert that the length of the operand is the expected value, or that the op eration throws an 4381 * Assert that the length of the operand is the expected value, or that the op eration throws an
4382 * exception if the expected value is `null`. 4382 * exception if the expected value is `null`.
4383 * 4383 *
4384 * @param expected the expected result of the operation 4384 * @param expected the expected result of the operation
4385 * @param operand the operand to the operation 4385 * @param operand the operand to the operation
4386 * @throws EvaluationException if the result is an exception when it should no t be 4386 * @throws EvaluationException if the result is an exception when it should no t be
4387 */ 4387 */
4388 void _assertStringLength(DartObjectImpl expected, DartObjectImpl operand) { 4388 void _assertStringLength(DartObjectImpl expected, DartObjectImpl operand) {
4389 if (expected == null) { 4389 if (expected == null) {
4390 try { 4390 try {
4391 operand.stringLength(_typeProvider); 4391 operand.stringLength(_typeProvider);
4392 fail("Expected an EvaluationException"); 4392 fail("Expected an EvaluationException");
4393 } on EvaluationException catch (exception) {} 4393 } on EvaluationException {}
4394 } else { 4394 } else {
4395 DartObjectImpl result = operand.stringLength(_typeProvider); 4395 DartObjectImpl result = operand.stringLength(_typeProvider);
4396 expect(result, isNotNull); 4396 expect(result, isNotNull);
4397 expect(result, expected); 4397 expect(result, expected);
4398 } 4398 }
4399 } 4399 }
4400 4400
4401 /** 4401 /**
4402 * Assert that the result of multiplying the left and right operands is the ex pected value, or 4402 * Assert that the result of multiplying the left and right operands is the ex pected value, or
4403 * that the operation throws an exception if the expected value is `null`. 4403 * that the operation throws an exception if the expected value is `null`.
4404 * 4404 *
4405 * @param expected the expected result of the operation 4405 * @param expected the expected result of the operation
4406 * @param leftOperand the left operand to the operation 4406 * @param leftOperand the left operand to the operation
4407 * @param rightOperand the left operand to the operation 4407 * @param rightOperand the left operand to the operation
4408 * @throws EvaluationException if the result is an exception when it should no t be 4408 * @throws EvaluationException if the result is an exception when it should no t be
4409 */ 4409 */
4410 void _assertTimes(DartObjectImpl expected, DartObjectImpl leftOperand, 4410 void _assertTimes(DartObjectImpl expected, DartObjectImpl leftOperand,
4411 DartObjectImpl rightOperand) { 4411 DartObjectImpl rightOperand) {
4412 if (expected == null) { 4412 if (expected == null) {
4413 try { 4413 try {
4414 leftOperand.times(_typeProvider, rightOperand); 4414 leftOperand.times(_typeProvider, rightOperand);
4415 fail("Expected an EvaluationException"); 4415 fail("Expected an EvaluationException");
4416 } on EvaluationException catch (exception) {} 4416 } on EvaluationException {}
4417 } else { 4417 } else {
4418 DartObjectImpl result = leftOperand.times(_typeProvider, rightOperand); 4418 DartObjectImpl result = leftOperand.times(_typeProvider, rightOperand);
4419 expect(result, isNotNull); 4419 expect(result, isNotNull);
4420 expect(result, expected); 4420 expect(result, expected);
4421 } 4421 }
4422 } 4422 }
4423 4423
4424 DartObjectImpl _boolValue(bool value) { 4424 DartObjectImpl _boolValue(bool value) {
4425 if (value == null) { 4425 if (value == null) {
4426 return new DartObjectImpl( 4426 return new DartObjectImpl(
(...skipping 3601 matching lines...) Expand 10 before | Expand all | Expand 10 after
8028 @reflectiveTest 8028 @reflectiveTest
8029 class SourceFactoryTest { 8029 class SourceFactoryTest {
8030 void test_creation() { 8030 void test_creation() {
8031 expect(new SourceFactory([]), isNotNull); 8031 expect(new SourceFactory([]), isNotNull);
8032 } 8032 }
8033 void test_fromEncoding_invalidUri() { 8033 void test_fromEncoding_invalidUri() {
8034 SourceFactory factory = new SourceFactory([]); 8034 SourceFactory factory = new SourceFactory([]);
8035 try { 8035 try {
8036 factory.fromEncoding("<:&%>"); 8036 factory.fromEncoding("<:&%>");
8037 fail("Expected IllegalArgumentException"); 8037 fail("Expected IllegalArgumentException");
8038 } on IllegalArgumentException catch (exception) {} 8038 } on IllegalArgumentException {}
8039 } 8039 }
8040 void test_fromEncoding_noResolver() { 8040 void test_fromEncoding_noResolver() {
8041 SourceFactory factory = new SourceFactory([]); 8041 SourceFactory factory = new SourceFactory([]);
8042 try { 8042 try {
8043 factory.fromEncoding("foo:/does/not/exist.dart"); 8043 factory.fromEncoding("foo:/does/not/exist.dart");
8044 fail("Expected IllegalArgumentException"); 8044 fail("Expected IllegalArgumentException");
8045 } on IllegalArgumentException catch (exception) {} 8045 } on IllegalArgumentException {}
8046 } 8046 }
8047 void test_fromEncoding_valid() { 8047 void test_fromEncoding_valid() {
8048 String encoding = "file:///does/not/exist.dart"; 8048 String encoding = "file:///does/not/exist.dart";
8049 SourceFactory factory = new SourceFactory( 8049 SourceFactory factory = new SourceFactory(
8050 [new UriResolver_SourceFactoryTest_test_fromEncoding_valid(encoding)]); 8050 [new UriResolver_SourceFactoryTest_test_fromEncoding_valid(encoding)]);
8051 expect(factory.fromEncoding(encoding), isNotNull); 8051 expect(factory.fromEncoding(encoding), isNotNull);
8052 } 8052 }
8053 void test_resolveUri_absolute() { 8053 void test_resolveUri_absolute() {
8054 UriResolver_absolute resolver = new UriResolver_absolute(); 8054 UriResolver_absolute resolver = new UriResolver_absolute();
8055 SourceFactory factory = new SourceFactory([resolver]); 8055 SourceFactory factory = new SourceFactory([resolver]);
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
8578 if (_expectedExternalScriptName == null) { 8578 if (_expectedExternalScriptName == null) {
8579 expect(scriptSource, isNull, reason: "script $scriptIndex"); 8579 expect(scriptSource, isNull, reason: "script $scriptIndex");
8580 } else { 8580 } else {
8581 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); 8581 expect(scriptSource, isNotNull, reason: "script $scriptIndex");
8582 String actualExternalScriptName = scriptSource.shortName; 8582 String actualExternalScriptName = scriptSource.shortName;
8583 expect(actualExternalScriptName, _expectedExternalScriptName, 8583 expect(actualExternalScriptName, _expectedExternalScriptName,
8584 reason: "script $scriptIndex"); 8584 reason: "script $scriptIndex");
8585 } 8585 }
8586 } 8586 }
8587 } 8587 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/task/model.dart ('k') | pkg/analyzer/test/generated/ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698