test/stubgen: add interface gen test

This commit is contained in:
2026-07-09 15:39:31 +08:00
parent 5ba32908b4
commit b15afe03d0
3 changed files with 30 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
@0xa1a2a3a4a5a6a7a8;
struct Person {
name @0 :Text;
age @1 :Int32;
}
enum Status {
active @0;
inactive @1;
}
+8
View File
@@ -0,0 +1,8 @@
@0xb1b2b3b4b5b6b7b8;
using Import = import "base.capnp";
struct Team {
members @0 :List(Import.Person);
status @1 :Import.Status;
}
+11
View File
@@ -0,0 +1,11 @@
@0xa1b2c3d4e5f6a7b8;
interface Calculator {
evaluate @0 (expression :Text) -> (value :Float64);
add @1 (a :Float64, b :Float64) -> (result :Float64);
ping @2 () -> ();
}
struct CalcServer {
calc @0 :Calculator;
}