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

Side by Side Diff: tests/compiler/dart2js/simple_inferrer_test.dart

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 years, 2 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 7 import
8 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' 8 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'
9 show TypeMask; 9 show TypeMask;
10 10
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 checkReturn('testReturnItselfOrInt', typesTask.intType); 786 checkReturn('testReturnItselfOrInt', typesTask.intType);
787 checkReturn('testReturnInvokeDynamicGetter', typesTask.dynamicType); 787 checkReturn('testReturnInvokeDynamicGetter', typesTask.dynamicType);
788 788
789 checkReturn('testDoWhile1', typesTask.stringType); 789 checkReturn('testDoWhile1', typesTask.stringType);
790 checkReturn('testDoWhile2', typesTask.nullType); 790 checkReturn('testDoWhile2', typesTask.nullType);
791 checkReturn('testDoWhile3', typesTask.intType); 791 checkReturn('testDoWhile3', typesTask.intType);
792 checkReturn('testDoWhile4', typesTask.numType); 792 checkReturn('testDoWhile4', typesTask.numType);
793 793
794 checkReturnInClass(String className, String methodName, type) { 794 checkReturnInClass(String className, String methodName, type) {
795 var cls = findElement(compiler, className); 795 var cls = findElement(compiler, className);
796 var element = cls.lookupLocalMember(buildSourceString(methodName)); 796 var element = cls.lookupLocalMember(methodName);
797 Expect.equals(type, 797 Expect.equals(type,
798 typesInferrer.getReturnTypeOfElement(element).simplify(compiler)); 798 typesInferrer.getReturnTypeOfElement(element).simplify(compiler));
799 } 799 }
800 800
801 checkReturnInClass('A', 'returnInt1', typesTask.intType); 801 checkReturnInClass('A', 'returnInt1', typesTask.intType);
802 checkReturnInClass('A', 'returnInt2', typesTask.intType); 802 checkReturnInClass('A', 'returnInt2', typesTask.intType);
803 checkReturnInClass('A', 'returnInt3', typesTask.intType); 803 checkReturnInClass('A', 'returnInt3', typesTask.intType);
804 checkReturnInClass('A', 'returnInt4', typesTask.intType); 804 checkReturnInClass('A', 'returnInt4', typesTask.intType);
805 checkReturnInClass('A', 'returnInt5', typesTask.intType); 805 checkReturnInClass('A', 'returnInt5', typesTask.intType);
806 checkReturnInClass('A', 'returnInt6', typesTask.intType); 806 checkReturnInClass('A', 'returnInt6', typesTask.intType);
807 checkReturnInClass('A', '==', interceptorType); 807 checkReturnInClass('A', '==', interceptorType);
808 808
809 checkReturnInClass('B', 'returnInt1', typesTask.intType); 809 checkReturnInClass('B', 'returnInt1', typesTask.intType);
810 checkReturnInClass('B', 'returnInt2', typesTask.intType); 810 checkReturnInClass('B', 'returnInt2', typesTask.intType);
811 checkReturnInClass('B', 'returnInt3', typesTask.intType); 811 checkReturnInClass('B', 'returnInt3', typesTask.intType);
812 checkReturnInClass('B', 'returnInt4', typesTask.intType); 812 checkReturnInClass('B', 'returnInt4', typesTask.intType);
813 checkReturnInClass('B', 'returnInt5', typesTask.intType); 813 checkReturnInClass('B', 'returnInt5', typesTask.intType);
814 checkReturnInClass('B', 'returnInt6', typesTask.intType); 814 checkReturnInClass('B', 'returnInt6', typesTask.intType);
815 checkReturnInClass('B', 'returnInt7', typesTask.intType); 815 checkReturnInClass('B', 'returnInt7', typesTask.intType);
816 checkReturnInClass('B', 'returnInt8', typesTask.intType); 816 checkReturnInClass('B', 'returnInt8', typesTask.intType);
817 checkReturnInClass('B', 'returnInt9', typesTask.intType); 817 checkReturnInClass('B', 'returnInt9', typesTask.intType);
818 818
819 checkFactoryConstructor(String className, String factoryName) { 819 checkFactoryConstructor(String className, String factoryName) {
820 var cls = findElement(compiler, className); 820 var cls = findElement(compiler, className);
821 var element = cls.localLookup(buildSourceString(factoryName)); 821 var element = cls.localLookup(factoryName);
822 Expect.equals(new TypeMask.nonNullExact(cls), 822 Expect.equals(new TypeMask.nonNullExact(cls),
823 typesInferrer.getReturnTypeOfElement(element)); 823 typesInferrer.getReturnTypeOfElement(element));
824 } 824 }
825 checkFactoryConstructor('A', ''); 825 checkFactoryConstructor('A', '');
826 826
827 checkReturn('testCascade1', typesTask.growableListType); 827 checkReturn('testCascade1', typesTask.growableListType);
828 checkReturn('testCascade2', new TypeMask.nonNullExact( 828 checkReturn('testCascade2', new TypeMask.nonNullExact(
829 findElement(compiler, 'CascadeHelper'))); 829 findElement(compiler, 'CascadeHelper')));
830 checkReturn('testSpecialization1', typesTask.numType); 830 checkReturn('testSpecialization1', typesTask.numType);
831 checkReturn('testSpecialization2', typesTask.dynamicType); 831 checkReturn('testSpecialization2', typesTask.dynamicType);
832 checkReturn('testSpecialization3', typesTask.intType.nullable()); 832 checkReturn('testSpecialization3', typesTask.intType.nullable());
833 checkReturn('testReturnNull1', typesTask.nullType); 833 checkReturn('testReturnNull1', typesTask.nullType);
834 checkReturn('testReturnNull2', typesTask.nullType); 834 checkReturn('testReturnNull2', typesTask.nullType);
835 checkReturn('testReturnNull3', typesTask.dynamicType); 835 checkReturn('testReturnNull3', typesTask.dynamicType);
836 checkReturn('testReturnNull4', typesTask.nullType); 836 checkReturn('testReturnNull4', typesTask.nullType);
837 checkReturn('testReturnNull5', typesTask.nullType); 837 checkReturn('testReturnNull5', typesTask.nullType);
838 checkReturn('testReturnNull6', typesTask.dynamicType); 838 checkReturn('testReturnNull6', typesTask.dynamicType);
839 })); 839 }));
840 } 840 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698