@@ -43,31 +43,31 @@ message Message {
43
43
44
44
extensions 10 to 100;
45
45
extend Message {
46
- int32 bar = 10 [features.amazing_feature = I];
46
+ required int32 bar = 10 [features.amazing_feature = I];
47
47
}
48
48
49
49
message Nested {
50
- option features.amazing_feature = H;
51
- optional int32 count = 1 ;
50
+ option features.amazing_feature = H;
51
+ optional int64 count = 9 ;
52
52
}
53
53
54
- enum SomeEnum {
54
+ enum SomeEnumInMessage {
55
55
option features.amazing_feature = G;
56
- ONE = 1 ;
57
- TWO = 2 ;
56
+ ONE = 11 ;
57
+ TWO = 12 ;
58
58
}
59
59
60
- oneof bar {
60
+ oneof SomeOneOf {
61
61
option features.amazing_feature = J;
62
- int32 a = 1 ;
63
- string b = 2 ;
62
+ int32 a = 13 ;
63
+ string b = 14 ;
64
64
}
65
65
66
- map<string,int64> int64_map = 9 ;
66
+ map<string,int64> int64_map = 15 ;
67
67
}
68
68
69
69
extend Message {
70
- int32 bar = 11 [features.amazing_feature = D];
70
+ required int32 bar = 16 [features.amazing_feature = D];
71
71
}
72
72
73
73
enum SomeEnum {
@@ -83,33 +83,22 @@ var tape = require("tape");
83
83
var protobuf = require ( ".." ) ;
84
84
85
85
86
- tape . test . only ( "feature resolution editions" , function ( test ) {
86
+ tape . test ( "feature resolution editions" , function ( test ) {
87
87
88
88
protobuf . load ( "tests/data/feature-resolution.proto" , function ( err , root ) {
89
89
if ( err )
90
90
return test . fail ( err . message ) ;
91
-
92
- // test.same(root.fea, {
93
- // 1: "a",
94
- // 2: "b"
95
- // }, "should also expose their values by id");
96
-
97
- // console.log(root.features.amazing_feature)
98
-
99
- test . same ( root . features . amazing_feature , 'A' ) ;
100
- test . same ( root . lookup ( "Message" ) . features . amazing_feature , 'B' )
101
- test . same ( root . lookupService ( "MyService" ) . features . amazing_feature , 'E' ) ;
102
- test . same ( root . lookupEnum ( "SomeEnum" ) . features . amazing_feature , 'C' )
103
- test . same ( root . lookup ( "Message" ) . lookupEnum ( "SomeEnumInMessage" ) . features . amazing_feature , 'G' )
104
- test . same ( root . lookup ( "Message" ) . lookup ( "Nested" ) . features . amazing_feature , 'H' )
105
- test . same ( root . lookupService ( "MyService" ) . lookup ( "MyMethod" ) . features . amazing_feature , 'L' )
106
- test . same ( root . lookup ( "Message" ) . fields . stringRepeated . features . amazing_feature , 'F' )
107
- test . same ( root . lookup ( "Message" ) . lookup ( ".Message.bar" ) . features . amazing_feature , 'I' )
108
- test . same ( root . lookupEnum ( "SomeEnum" ) . valuesFeatures . ONE . amazing_feature , 'K' )
109
-
110
- test . end ( ) ;
91
+ test . same ( root . features . amazing_feature , 'A' ) ;
92
+ test . same ( root . lookup ( "Message" ) . features . amazing_feature , 'B' )
93
+ test . same ( root . lookupService ( "MyService" ) . features . amazing_feature , 'E' ) ;
94
+ test . same ( root . lookupEnum ( "SomeEnum" ) . features . amazing_feature , 'C' )
95
+ test . same ( root . lookup ( "Message" ) . lookupEnum ( "SomeEnumInMessage" ) . features . amazing_feature , 'G' )
96
+ test . same ( root . lookup ( "Message" ) . lookup ( "Nested" ) . features . amazing_feature , 'H' )
97
+ test . same ( root . lookupService ( "MyService" ) . lookup ( "MyMethod" ) . features . amazing_feature , 'L' )
98
+ test . same ( root . lookup ( "Message" ) . fields . stringRepeated . features . amazing_feature , 'F' )
99
+ test . same ( root . lookup ( "Message" ) . lookup ( ".Message.bar" ) . features . amazing_feature , 'I' )
100
+ test . same ( root . lookupEnum ( "SomeEnum" ) . valuesFeatures . ONE . amazing_feature , 'K' )
101
+
102
+ test . end ( ) ;
103
+ } )
111
104
} )
112
-
113
-
114
-
115
- } )
0 commit comments