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

Unified Diff: test/protoc_options_test.dart

Issue 2043913005: Change how to set the Dart name of a field (Closed) Base URL: git@github.com:dart-lang/dart-protoc-plugin.git@master
Patch Set: better error checking, clean up pubspec Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: test/protoc_options_test.dart
diff --git a/test/protoc_options_test.dart b/test/protoc_options_test.dart
index 42acb2731484f885566e3fb9a3b3c9f5c635019f..b4f516da3c5dbfd2dbede19bb08e97169689ec44 100644
--- a/test/protoc_options_test.dart
+++ b/test/protoc_options_test.dart
@@ -9,30 +9,22 @@ import 'package:protoc_plugin/src/plugin.pb.dart';
import 'package:protoc_plugin/protoc.dart';
import 'package:test/test.dart';
-
void main() {
test('testValidGeneratorOptions', () {
- checkValid(String parameter, Map expected) {
+ checkValid(String parameter) {
var request = new CodeGeneratorRequest();
if (parameter != null) request.parameter = parameter;
var response = new CodeGeneratorResponse();
var options = parseGenerationOptions(request, response);
expect(options, new isInstanceOf<GenerationOptions>());
expect(response.error, '');
- expect(options.fieldNameOverrides, equals(expected));
}
- checkValid(null, {});
- checkValid('', {});
- checkValid(',', {});
- checkValid(',,,', {});
- checkValid(' , , ,', {});
-
- checkValid('field_name=a|b', {'.a' : 'b'});
- checkValid('field_name = a | b,,,', {'.a' : 'b'});
- checkValid('field_name=a|b,field_name=p.C|d', {'.a' : 'b', '.p.C' : 'd'});
- checkValid(' field_name = a | b, , field_name = p.C | d ',
- {'.a' : 'b', '.p.C' : 'd'});
+ checkValid(null);
+ checkValid('');
+ checkValid(',');
+ checkValid(',,,');
+ checkValid(' , , ,');
});
test('testInvalidGeneratorOptions', () {
@@ -46,10 +38,5 @@ void main() {
checkInvalid('abc');
checkInvalid('abc,def');
- checkInvalid('field_name=');
- checkInvalid('field_name=a');
- checkInvalid('field_name=a|');
- checkInvalid('field_name=|');
- checkInvalid('field_name=|b');
});
}
« test/names_test.dart ('K') | « test/names_test.dart ('k') | test/protos/dart_name.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698