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

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

Issue 1027453003: Fix constant evaluation of division. (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
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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 void test_divide_double_double_byZero() { 583 void test_divide_double_double_byZero() {
584 EvaluationResult result = _getExpressionValue("3.2 / 0.0"); 584 EvaluationResult result = _getExpressionValue("3.2 / 0.0");
585 expect(result.isValid, isTrue); 585 expect(result.isValid, isTrue);
586 DartObject value = result.value; 586 DartObject value = result.value;
587 expect(value.type.name, "double"); 587 expect(value.type.name, "double");
588 expect(value.doubleValue.isInfinite, isTrue); 588 expect(value.doubleValue.isInfinite, isTrue);
589 } 589 }
590 590
591 void test_divide_int_int() { 591 void test_divide_int_int() {
592 _assertValue3(1, "3 / 2"); 592 _assertValue2(1.5, "3 / 2");
593 } 593 }
594 void test_divide_int_int_byZero() { 594 void test_divide_int_int_byZero() {
595 EvaluationResult result = _getExpressionValue("3 / 0"); 595 EvaluationResult result = _getExpressionValue("3 / 0");
596 expect(result.isValid, isTrue); 596 expect(result.isValid, isTrue);
597 } 597 }
598 598
599 void test_equal_boolean_boolean() { 599 void test_equal_boolean_boolean() {
600 _assertValue(false, "true == false"); 600 _assertValue(false, "true == false");
601 } 601 }
602 602
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 2569
2570 void test_divide_knownDouble_unknownDouble() { 2570 void test_divide_knownDouble_unknownDouble() {
2571 _assertDivide(_doubleValue(null), _doubleValue(6.0), _doubleValue(null)); 2571 _assertDivide(_doubleValue(null), _doubleValue(6.0), _doubleValue(null));
2572 } 2572 }
2573 2573
2574 void test_divide_knownDouble_unknownInt() { 2574 void test_divide_knownDouble_unknownInt() {
2575 _assertDivide(_doubleValue(null), _doubleValue(6.0), _intValue(null)); 2575 _assertDivide(_doubleValue(null), _doubleValue(6.0), _intValue(null));
2576 } 2576 }
2577 2577
2578 void test_divide_knownInt_knownInt() { 2578 void test_divide_knownInt_knownInt() {
2579 _assertDivide(_intValue(3), _intValue(6), _intValue(2)); 2579 _assertDivide(_doubleValue(3.0), _intValue(6), _intValue(2));
2580 } 2580 }
2581 2581
2582 void test_divide_knownInt_knownString() { 2582 void test_divide_knownInt_knownString() {
2583 _assertDivide(null, _intValue(6), _stringValue("2")); 2583 _assertDivide(null, _intValue(6), _stringValue("2"));
2584 } 2584 }
2585 2585
2586 void test_divide_knownInt_unknownDouble() { 2586 void test_divide_knownInt_unknownDouble() {
2587 _assertDivide(_doubleValue(null), _intValue(6), _doubleValue(null)); 2587 _assertDivide(_doubleValue(null), _intValue(6), _doubleValue(null));
2588 } 2588 }
2589 2589
2590 void test_divide_knownInt_unknownInt() { 2590 void test_divide_knownInt_unknownInt() {
2591 _assertDivide(_intValue(null), _intValue(6), _intValue(null)); 2591 _assertDivide(_doubleValue(null), _intValue(6), _intValue(null));
2592 } 2592 }
2593 2593
2594 void test_divide_knownString_knownInt() { 2594 void test_divide_knownString_knownInt() {
2595 _assertDivide(null, _stringValue("6"), _intValue(2)); 2595 _assertDivide(null, _stringValue("6"), _intValue(2));
2596 } 2596 }
2597 2597
2598 void test_divide_unknownDouble_knownDouble() { 2598 void test_divide_unknownDouble_knownDouble() {
2599 _assertDivide(_doubleValue(null), _doubleValue(null), _doubleValue(2.0)); 2599 _assertDivide(_doubleValue(null), _doubleValue(null), _doubleValue(2.0));
2600 } 2600 }
2601 2601
2602 void test_divide_unknownDouble_knownInt() { 2602 void test_divide_unknownDouble_knownInt() {
2603 _assertDivide(_doubleValue(null), _doubleValue(null), _intValue(2)); 2603 _assertDivide(_doubleValue(null), _doubleValue(null), _intValue(2));
2604 } 2604 }
2605 2605
2606 void test_divide_unknownInt_knownDouble() { 2606 void test_divide_unknownInt_knownDouble() {
2607 _assertDivide(_doubleValue(null), _intValue(null), _doubleValue(2.0)); 2607 _assertDivide(_doubleValue(null), _intValue(null), _doubleValue(2.0));
2608 } 2608 }
2609 2609
2610 void test_divide_unknownInt_knownInt() { 2610 void test_divide_unknownInt_knownInt() {
2611 _assertDivide(_intValue(null), _intValue(null), _intValue(2)); 2611 _assertDivide(_doubleValue(null), _intValue(null), _intValue(2));
2612 } 2612 }
2613 2613
2614 void test_equalEqual_bool_false() { 2614 void test_equalEqual_bool_false() {
2615 _assertEqualEqual(_boolValue(false), _boolValue(false), _boolValue(true)); 2615 _assertEqualEqual(_boolValue(false), _boolValue(false), _boolValue(true));
2616 } 2616 }
2617 2617
2618 void test_equalEqual_bool_true() { 2618 void test_equalEqual_bool_true() {
2619 _assertEqualEqual(_boolValue(true), _boolValue(true), _boolValue(true)); 2619 _assertEqualEqual(_boolValue(true), _boolValue(true), _boolValue(true));
2620 } 2620 }
2621 2621
(...skipping 5956 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
« pkg/analyzer/lib/src/generated/constant.dart ('K') | « pkg/analyzer/lib/src/generated/constant.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698