OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 library generated_message_test; | 6 library generated_message_test; |
7 | 7 |
8 import 'package:protobuf/protobuf.dart'; | 8 import 'package:protobuf/protobuf.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
11 import '../out/protos/google/protobuf/unittest.pb.dart'; | 11 import '../out/protos/google/protobuf/unittest.pb.dart'; |
12 import '../out/protos/google/protobuf/unittest_import.pb.dart'; | 12 import '../out/protos/google/protobuf/unittest_import.pb.dart'; |
13 import '../out/protos/google/protobuf/unittest_optimize_for.pb.dart'; | 13 import '../out/protos/google/protobuf/unittest_optimize_for.pb.dart'; |
14 import '../out/protos/multiple_files_test.pb.dart'; | 14 import '../out/protos/multiple_files_test.pb.dart'; |
15 import '../out/protos/nested_extension.pb.dart'; | 15 import '../out/protos/nested_extension.pb.dart'; |
16 import '../out/protos/non_nested_extension.pb.dart'; | 16 import '../out/protos/non_nested_extension.pb.dart'; |
17 import '../out/protos/reserved_names.pb.dart'; | 17 import '../out/protos/reserved_names.pb.dart'; |
18 import '../out/protos/duplicate_names_import.pb.dart'; | 18 import '../out/protos/duplicate_names_import.pb.dart'; |
19 import '../out/protos/package1.pb.dart' as p1; | 19 import '../out/protos/package1.pb.dart' as p1; |
20 import '../out/protos/package2.pb.dart' as p2; | 20 import '../out/protos/package2.pb.dart' as p2; |
21 import '../out/protos/package3.pb.dart' as p3; | 21 import '../out/protos/package3.pb.dart' as p3; |
| 22 import '../out/protos/toplevel_import.pb.dart' as t; |
| 23 import '../out/protos/toplevel.pb.dart'; |
22 | 24 |
23 import 'test_util.dart'; | 25 import 'test_util.dart'; |
24 | 26 |
25 void main() { | 27 void main() { |
26 final throwsInvalidProtocolBufferException = | 28 final throwsInvalidProtocolBufferException = |
27 throwsA(new isInstanceOf<InvalidProtocolBufferException>()); | 29 throwsA(new isInstanceOf<InvalidProtocolBufferException>()); |
28 test('testProtosShareRepeatedArraysIfDidntChange', () { | 30 test('testProtosShareRepeatedArraysIfDidntChange', () { |
29 TestAllTypes value1 = new TestAllTypes() | 31 TestAllTypes value1 = new TestAllTypes() |
30 ..repeatedInt32.add(100) | 32 ..repeatedInt32.add(100) |
31 ..repeatedImportEnum.add(ImportEnum.IMPORT_BAR) | 33 ..repeatedImportEnum.add(ImportEnum.IMPORT_BAR) |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 594 |
593 test('testImportDuplicatenames', () { | 595 test('testImportDuplicatenames', () { |
594 M message = new M(); | 596 M message = new M(); |
595 message.m1 = new p1.M(); | 597 message.m1 = new p1.M(); |
596 message.m1M = new p1.M_M(); | 598 message.m1M = new p1.M_M(); |
597 message.m2 = new p2.M(); | 599 message.m2 = new p2.M(); |
598 message.m2M = new p2.M_M(); | 600 message.m2M = new p2.M_M(); |
599 message.m3 = new p3.M(); | 601 message.m3 = new p3.M(); |
600 message.m3M = new p3.M_M(); | 602 message.m3M = new p3.M_M(); |
601 }); | 603 }); |
| 604 |
| 605 test('testToplevel', () { |
| 606 t.M message = new t.M(); |
| 607 message.t = new T(); |
| 608 }); |
602 } | 609 } |
OLD | NEW |