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

Side by Side Diff: utils/tests/pub/pub_test.dart

Issue 10825375: Reverting 10779 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « utils/pub/version_solver.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #library('pub_tests'); 5 #library('pub_tests');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 8
9 #import('test_pub.dart'); 9 #import('test_pub.dart');
10 #import('../../../pkg/unittest/unittest.dart'); 10 #import('../../../pkg/unittest/unittest.dart');
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 output: const RegExp(@"Dependencies installed!$")); 861 output: const RegExp(@"Dependencies installed!$"));
862 862
863 dir(packagesPath, [ 863 dir(packagesPath, [
864 dir('foo', [ 864 dir('foo', [
865 file('foo.dart', 'main() => print("foo 1.0.0");') 865 file('foo.dart', 'main() => print("foo 1.0.0");')
866 ]) 866 ])
867 ]).scheduleValidate(); 867 ]).scheduleValidate();
868 868
869 run(); 869 run();
870 }); 870 });
871
872 test("unlocks dependencies if necessary to ensure that a new dependency "
873 "is satisfied", () {
874 servePackages("localhost", 3123, [
875 '''
876 name: foo
877 version: 1.0.0
878 dependencies:
879 bar:
880 version: "<2.0.0"
881 repo: {name: bar, url: http://localhost:3123}
882 ''',
883 '''
884 name: bar
885 version: 1.0.0
886 dependencies:
887 baz:
888 version: "<2.0.0"
889 repo: {name: baz, url: http://localhost:3123}
890 ''',
891 '''
892 name: baz
893 version: 1.0.0
894 dependencies:
895 qux:
896 version: "<2.0.0"
897 repo: {name: qux, url: http://localhost:3123}
898 ''',
899 '''
900 name: qux
901 version: 1.0.0
902 ''']);
903
904 dir(appPath, [
905 file('pubspec.yaml', '''
906 dependencies:
907 foo:
908 repo: {name: foo, url: http://localhost:3123}
909 ''')
910 ]).scheduleCreate();
911
912 schedulePub(args: ['install'],
913 output: const RegExp(@"Dependencies installed!$"));
914
915 dir(packagesPath, [
916 dir('foo', [
917 file('foo.dart', 'main() => print("foo 1.0.0");')
918 ]),
919 dir('bar', [
920 file('bar.dart', 'main() => print("bar 1.0.0");')
921 ]),
922 dir('baz', [
923 file('baz.dart', 'main() => print("baz 1.0.0");')
924 ]),
925 dir('qux', [
926 file('qux.dart', 'main() => print("qux 1.0.0");')
927 ])
928 ]).scheduleValidate();
929
930 servePackages("localhost", 3123, [
931 '''
932 name: foo
933 version: 1.0.0
934 dependencies:
935 bar:
936 version: "<2.0.0"
937 repo: {name: bar, url: http://localhost:3123}
938 ''',
939 '''
940 name: foo
941 version: 2.0.0
942 dependencies:
943 bar:
944 version: "<3.0.0"
945 repo: {name: bar, url: http://localhost:3123}
946 ''',
947 '''
948 name: bar
949 version: 1.0.0
950 dependencies:
951 baz:
952 version: "<2.0.0"
953 repo: {name: baz, url: http://localhost:3123}
954 ''',
955 '''
956 name: bar
957 version: 2.0.0
958 dependencies:
959 baz:
960 version: "<3.0.0"
961 repo: {name: baz, url: http://localhost:3123}
962 ''',
963 '''
964 name: baz
965 version: 1.0.0
966 dependencies:
967 qux:
968 version: "<2.0.0"
969 repo: {name: qux, url: http://localhost:3123}
970 ''',
971 '''
972 name: baz
973 version: 2.0.0
974 dependencies:
975 qux:
976 version: "<3.0.0"
977 repo: {name: qux, url: http://localhost:3123}
978 ''',
979 '''
980 name: qux
981 version: 1.0.0
982 ''',
983 '''
984 name: qux
985 version: 2.0.0
986 ''',
987 '''
988 name: newdep
989 version: 2.0.0
990 dependencies:
991 baz:
992 version: ">=1.5.0"
993 repo: {name: baz, url: http://localhost:3123}
994 ''']);
995
996 dir(appPath, [
997 file('pubspec.yaml', '''
998 dependencies:
999 foo:
1000 repo: {name: foo, url: http://localhost:3123}
1001 newdep:
1002 repo: {name: newdep, url: http://localhost:3123}
1003 ''')
1004 ]).scheduleCreate();
1005
1006 schedulePub(args: ['install'],
1007 output: const RegExp(@"Dependencies installed!$"));
1008
1009 dir(packagesPath, [
1010 dir('foo', [
1011 file('foo.dart', 'main() => print("foo 2.0.0");')
1012 ]),
1013 dir('bar', [
1014 file('bar.dart', 'main() => print("bar 2.0.0");')
1015 ]),
1016 dir('baz', [
1017 file('baz.dart', 'main() => print("baz 2.0.0");')
1018 ]),
1019 dir('qux', [
1020 file('qux.dart', 'main() => print("qux 1.0.0");')
1021 ]),
1022 dir('newdep', [
1023 file('newdep.dart', 'main() => print("newdep 2.0.0");')
1024 ])
1025 ]).scheduleValidate();
1026
1027 run();
1028 });
1029
1030 test("doesn't unlock dependencies if a new dependency is already "
1031 "satisfied", () {
1032 servePackages("localhost", 3123, [
1033 '''
1034 name: foo
1035 version: 1.0.0
1036 dependencies:
1037 bar:
1038 version: "<2.0.0"
1039 repo: {name: bar, url: http://localhost:3123}
1040 ''',
1041 '''
1042 name: bar
1043 version: 1.0.0
1044 dependencies:
1045 baz:
1046 version: "<2.0.0"
1047 repo: {name: baz, url: http://localhost:3123}
1048 ''',
1049 '''
1050 name: baz
1051 version: 1.0.0
1052 ''']);
1053
1054 dir(appPath, [
1055 file('pubspec.yaml', '''
1056 dependencies:
1057 foo:
1058 repo: {name: foo, url: http://localhost:3123}
1059 ''')
1060 ]).scheduleCreate();
1061
1062 schedulePub(args: ['install'],
1063 output: const RegExp(@"Dependencies installed!$"));
1064
1065 dir(packagesPath, [
1066 dir('foo', [
1067 file('foo.dart', 'main() => print("foo 1.0.0");')
1068 ]),
1069 dir('bar', [
1070 file('bar.dart', 'main() => print("bar 1.0.0");')
1071 ]),
1072 dir('baz', [
1073 file('baz.dart', 'main() => print("baz 1.0.0");')
1074 ])
1075 ]).scheduleValidate();
1076
1077 servePackages("localhost", 3123, [
1078 '''
1079 name: foo
1080 version: 1.0.0
1081 dependencies:
1082 bar:
1083 version: "<2.0.0"
1084 repo: {name: bar, url: http://localhost:3123}
1085 ''',
1086 '''
1087 name: foo
1088 version: 2.0.0
1089 dependencies:
1090 bar:
1091 version: "<3.0.0"
1092 repo: {name: bar, url: http://localhost:3123}
1093 ''',
1094 '''
1095 name: bar
1096 version: 1.0.0
1097 dependencies:
1098 baz:
1099 version: "<2.0.0"
1100 repo: {name: baz, url: http://localhost:3123}
1101 ''',
1102 '''
1103 name: bar
1104 version: 2.0.0
1105 dependencies:
1106 baz:
1107 version: "<3.0.0"
1108 repo: {name: baz, url: http://localhost:3123}
1109 ''',
1110 '''
1111 name: baz
1112 version: 1.0.0
1113 ''',
1114 '''
1115 name: baz
1116 version: 2.0.0
1117 ''',
1118 '''
1119 name: newdep
1120 version: 2.0.0
1121 dependencies:
1122 baz:
1123 version: ">=1.0.0"
1124 repo: {name: baz, url: http://localhost:3123}
1125 ''']);
1126
1127 dir(appPath, [
1128 file('pubspec.yaml', '''
1129 dependencies:
1130 foo:
1131 repo: {name: foo, url: http://localhost:3123}
1132 newdep:
1133 repo: {name: newdep, url: http://localhost:3123}
1134 ''')
1135 ]).scheduleCreate();
1136
1137 schedulePub(args: ['install'],
1138 output: const RegExp(@"Dependencies installed!$"));
1139
1140 dir(packagesPath, [
1141 dir('foo', [
1142 file('foo.dart', 'main() => print("foo 1.0.0");')
1143 ]),
1144 dir('bar', [
1145 file('bar.dart', 'main() => print("bar 1.0.0");')
1146 ]),
1147 dir('baz', [
1148 file('baz.dart', 'main() => print("baz 1.0.0");')
1149 ]),
1150 dir('newdep', [
1151 file('newdep.dart', 'main() => print("newdep 2.0.0");')
1152 ])
1153 ]).scheduleValidate();
1154
1155 run();
1156 });
1157 } 871 }
1158 872
1159 updateCommand() { 873 updateCommand() {
1160 test("updates locked Git packages", () { 874 test("updates locked Git packages", () {
1161 ensureGit(); 875 ensureGit();
1162 876
1163 git('foo.git', [ 877 git('foo.git', [
1164 file('foo.dart', 'main() => "foo";') 878 file('foo.dart', 'main() => "foo";')
1165 ]).scheduleCreate(); 879 ]).scheduleCreate();
1166 880
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 version: ">1.0.0" 1132 version: ">1.0.0"
1419 ''') 1133 ''')
1420 ]), 1134 ]),
1421 dir('foo-dep', [ 1135 dir('foo-dep', [
1422 file('foo-dep.dart', 'main() => print("foo-dep 2.0.0");') 1136 file('foo-dep.dart', 'main() => print("foo-dep 2.0.0");')
1423 ]) 1137 ])
1424 ]).scheduleValidate(); 1138 ]).scheduleValidate();
1425 1139
1426 run(); 1140 run();
1427 }); 1141 });
1428
1429 test("updates a locked package's dependers in order to get it to max "
1430 "version", () {
1431 servePackages("localhost", 3123, [
1432 '''
1433 name: foo
1434 version: 1.0.0
1435 dependencies:
1436 bar:
1437 version: "<2.0.0"
1438 repo: {name: bar, url: http://localhost:3123}
1439 ''',
1440 '{name: bar, version: 1.0.0}'
1441 ]);
1442
1443 dir(appPath, [
1444 file('pubspec.yaml', '''
1445 dependencies:
1446 foo:
1447 repo: {name: foo, url: http://localhost:3123}
1448 bar:
1449 repo: {name: bar, url: http://localhost:3123}
1450 ''')
1451 ]).scheduleCreate();
1452
1453 schedulePub(args: ['install'],
1454 output: const RegExp(@"Dependencies installed!$"));
1455
1456 dir(packagesPath, [
1457 dir('foo', [
1458 file('foo.dart', 'main() => print("foo 1.0.0");'),
1459 ]),
1460 dir('bar', [
1461 file('bar.dart', 'main() => print("bar 1.0.0");')
1462 ])
1463 ]).scheduleValidate();
1464
1465 servePackages("localhost", 3123, [
1466 '''
1467 name: foo
1468 version: 1.0.0
1469 dependencies:
1470 bar:
1471 version: "<2.0.0"
1472 repo: {name: bar, url: http://localhost:3123}
1473 ''',
1474 '''
1475 name: foo
1476 version: 2.0.0
1477 dependencies:
1478 bar:
1479 version: "<3.0.0"
1480 repo: {name: bar, url: http://localhost:3123}
1481 ''',
1482 '{name: bar, version: 1.0.0}',
1483 '{name: bar, version: 2.0.0}'
1484 ]);
1485
1486 schedulePub(args: ['update', 'bar'],
1487 output: const RegExp(@"Dependencies updated!$"));
1488
1489 dir(packagesPath, [
1490 dir('foo', [
1491 file('foo.dart', 'main() => print("foo 2.0.0");'),
1492 ]),
1493 dir('bar', [
1494 file('bar.dart', 'main() => print("bar 2.0.0");')
1495 ])
1496 ]).scheduleValidate();
1497
1498 run();
1499 });
1500 }); 1142 });
1501 } 1143 }
1502 1144
1503 versionCommand() { 1145 versionCommand() {
1504 test('displays the current version', () => 1146 test('displays the current version', () =>
1505 runPub(args: ['version'], output: VERSION_STRING)); 1147 runPub(args: ['version'], output: VERSION_STRING));
1506 } 1148 }
OLDNEW
« no previous file with comments | « utils/pub/version_solver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698