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 message_generator_test; | 6 library message_generator_test; |
7 | 7 |
8 import 'package:protoc_plugin/src/descriptor.pb.dart'; | 8 import 'package:protoc_plugin/src/descriptor.pb.dart'; |
9 import 'package:protoc_plugin/src/plugin.pb.dart'; | 9 import 'package:protoc_plugin/src/plugin.pb.dart'; |
10 import 'package:protoc_plugin/protoc.dart'; | 10 import 'package:protoc_plugin/protoc.dart'; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ..defaultValue = r'$' | 105 ..defaultValue = r'$' |
106 ]) | 106 ]) |
107 ..enumType.add(ed); | 107 ..enumType.add(ed); |
108 MemoryWriter buffer = new MemoryWriter(); | 108 MemoryWriter buffer = new MemoryWriter(); |
109 IndentingWriter writer = new IndentingWriter(' ', buffer); | 109 IndentingWriter writer = new IndentingWriter(' ', buffer); |
110 var options = parseGenerationOptions( | 110 var options = parseGenerationOptions( |
111 new CodeGeneratorRequest(), new CodeGeneratorResponse()); | 111 new CodeGeneratorRequest(), new CodeGeneratorResponse()); |
112 var context = new GenerationContext(options, | 112 var context = new GenerationContext(options, |
113 new DefaultOutputConfiguration()); | 113 new DefaultOutputConfiguration()); |
114 FileGenerator fg = new FileGenerator(fd, null, context); | 114 FileGenerator fg = new FileGenerator(fd, null, context); |
115 MessageGenerator mg = new MessageGenerator(md, fg, context, false); | 115 MessageGenerator mg = new MessageGenerator(md, fg, context, null); |
116 mg.initializeFields(); | 116 mg.initializeFields(); |
117 mg.generate(writer); | 117 mg.generate(writer); |
118 expect(buffer.toString(), expected); | 118 expect(buffer.toString(), expected); |
119 }); | 119 }); |
120 } | 120 } |
OLD | NEW |