Add more thorough test cases

This commit is contained in:
2026-05-02 17:52:04 -07:00
parent 6912ff37d3
commit 4ee2dcb948
4 changed files with 183 additions and 0 deletions
BIN
View File
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
d_val: 3.1415926535
f_val: 2.71828
i32_val: 42
i64_val: 123456789012345
u32_val: 1000
u64_val: 18446744073709551615
si32_val: -42
si64_val: -123456789012345
fx32_val: 123456
fx64_val: 1234567890123456789
sfx32_val: -123456
sfx64_val: -1234567890123456789
b_val: true
s_val: "Hello Roto!"
bytes_val: "SGVsbG8gUm90byE="
status: ACTIVE
repeated_i32: 1
repeated_i32: 2
repeated_i32: 3
repeated_i32: 4
repeated_i32: 5
repeated_string: "one"
repeated_string: "two"
repeated_string: "three"
repeated_nested {
id: 101
name: "Nested 1"
active: true
}
repeated_nested {
id: 102
name: "Nested 2"
active: false
}
single_nested {
id: 200
name: "Single Nested"
active: true
}
+53
View File
@@ -0,0 +1,53 @@
syntax = "proto3";
package roto.test;
// A comprehensive message containing all primitive types and complex structures
// to test the proto-to-rust codegen and runtime accessors.
message ComplexMessage {
// --- Floating Point ---
double d_val = 1;
float f_val = 2;
// --- Integers (Variable Length) ---
int32 i32_val = 3;
int64 i64_val = 4;
uint32 u32_val = 5;
uint64 u64_val = 6;
sint32 si32_val = 7;
sint64 si64_val = 8;
// --- Integers (Fixed Length) ---
fixed32 fx32_val = 9;
fixed64 fx64_val = 10;
sfixed32 sfx32_val = 11;
sfixed64 sfx64_val = 12;
// --- Other Primitives ---
bool b_val = 13;
string s_val = 14;
bytes bytes_val = 15;
// --- Enumerations ---
enum Status {
UNKNOWN = 0;
ACTIVE = 1;
INACTIVE = 2;
DELETED = 3;
}
Status status = 16;
// --- Repeated Fields ---
// Testing packed primitives and non-packed types
repeated int32 repeated_i32 = 17;
repeated string repeated_string = 18;
repeated NestedMessage repeated_nested = 19;
// --- Nested Messages ---
message NestedMessage {
int32 id = 1;
string name = 2;
bool active = 3;
}
NestedMessage single_nested = 20;
}