File tree 2 files changed +12
-2
lines changed
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)
102
102
--plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH))\
103
103
$(TEST_PROTO_SRCS)
104
104
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
+
105
115
dart format $(TEST_PROTO_DIR)
106
116
107
117
update-pregenerated : $(PLUGIN_PATH ) $(PREGENERATED_SRCS )
Original file line number Diff line number Diff line change 1
1
import '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' ;
3
3
4
4
void main () {
5
5
group ('Optional fields should be nullable for' , () {
@@ -16,7 +16,7 @@ void main() {
16
16
expect (obj2.optionalSingleInt32, null );
17
17
// should not generate linting errors
18
18
expect (obj2.optionalSingleInt32 ?? 1 , 1 );
19
- expect (obj .hasOptionalSingleInt32 (), false );
19
+ expect (obj2 .hasOptionalSingleInt32 (), false );
20
20
});
21
21
});
22
22
}
You can’t perform that action at this time.
0 commit comments