Ruby nested msg caps (#5564)
* Ruby nested msg caps * nested types tests added * test cases added for RubifyConstant * extracted NestedMessage to TestNestedMessage * removed nested tests with leading underscore * extracted testLowercase to toplevel testLowercaseNested
This commit is contained in:
parent
0c95791509
commit
dda7ab0363
@ -69,6 +69,11 @@ enum TestEnum {
|
||||
C = 3;
|
||||
}
|
||||
|
||||
message testLowercaseNested {
|
||||
message lowercase{}
|
||||
}
|
||||
|
||||
|
||||
message TestUnknown {
|
||||
TestUnknown optional_unknown = 11;
|
||||
repeated TestUnknown repeated_unknown = 31;
|
||||
|
@ -15,6 +15,8 @@ class GeneratedCodeTest < Test::Unit::TestCase
|
||||
# successfully creates message definitions and classes, not to test every
|
||||
# aspect of the extension (basic.rb is for that).
|
||||
A::B::C::TestMessage.new
|
||||
A::B::C::TestMessage::NestedMessage.new
|
||||
A::B::C::TestLowercaseNested::Lowercase.new
|
||||
FooBar::TestImportedMessage.new
|
||||
A::B::TestRubyPackageMessage.new
|
||||
end
|
||||
|
@ -389,7 +389,7 @@ void GenerateMessageAssignment(
|
||||
"lookup(\"$full_name$\").msgclass\n",
|
||||
"full_name", message->full_name());
|
||||
|
||||
std::string nested_prefix = prefix + message->name() + "::";
|
||||
std::string nested_prefix = prefix + RubifyConstant(message->name()) + "::";
|
||||
for (int i = 0; i < message->nested_type_count(); i++) {
|
||||
GenerateMessageAssignment(nested_prefix, message->nested_type(i), printer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user