File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,16 @@ $(TEST_PROTO_LIBS): $(PLUGIN_SRC) $(TEST_PROTO_SRCS)
102102 --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH))\
103103 $(TEST_PROTO_SRCS)
104104
105+ mkdir -p $(TEST_PROTO_DIR)/nullable
106+
107+ protoc\
108+ --experimental_allow_proto3_optional\
109+ --dart_out="nullable:$(TEST_PROTO_DIR)/nullable"\
110+ -Iprotos\
111+ -I$(TEST_PROTO_SRC_DIR)\
112+ --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH))\
113+ $(TEST_PROTO_SRCS)
114+
105115 dart format $(TEST_PROTO_DIR)
106116
107117update-pregenerated : $(PLUGIN_PATH ) $(PREGENERATED_SRCS )
Original file line number Diff line number Diff line change 11import 'package:test/test.dart' ;
2- import '../out/protos/google/protobuf/unittest_proto3.pb.dart' ;
2+ import '../out/protos/nullable/ google/protobuf/unittest_proto3.pb.dart' ;
33
44void main () {
55 group ('Optional fields should be nullable for' , () {
@@ -16,7 +16,7 @@ void main() {
1616 expect (obj2.optionalSingleInt32, null );
1717 // should not generate linting errors
1818 expect (obj2.optionalSingleInt32 ?? 1 , 1 );
19- expect (obj .hasOptionalSingleInt32 (), false );
19+ expect (obj2 .hasOptionalSingleInt32 (), false );
2020 });
2121 });
2222}
You can’t perform that action at this time.
0 commit comments