github.com/stackb/rules_proto@v0.0.0-20240221195024-5428336c51f1/pkg/plugin/akka/akka_grpc/protoc_gen_akka_grpc_test.go (about) 1 package akka_grpc_test 2 3 import ( 4 "testing" 5 6 "github.com/stackb/rules_proto/pkg/plugin/akka/akka_grpc" 7 "github.com/stackb/rules_proto/pkg/plugintest" 8 ) 9 10 func TestProtoGenAkkaGrpcPlugin(t *testing.T) { 11 plugintest.Cases(t, &akka_grpc.ProtocGenAkkaGrpcPlugin{}, map[string]plugintest.Case{ 12 "empty file": { 13 Input: "", 14 Directives: plugintest.WithDirectives( 15 "proto_plugin", "akka implementation akka:akka-grpc:protoc-gen-akka-grpc", 16 ), 17 PluginName: "akka", 18 SkipIntegration: true, 19 }, 20 "only messages, no srcjar produced": { 21 Input: "package pkg;\n\nmessage M{}", 22 Directives: plugintest.WithDirectives( 23 "proto_plugin", "akka implementation akka:akka-grpc:protoc-gen-akka-grpc", 24 ), 25 PluginName: "akka", 26 SkipIntegration: true, 27 }, 28 "with service": { 29 Input: "package pkg;\n\nservice S{}", 30 Directives: plugintest.WithDirectives( 31 "proto_plugin", "akka implementation akka:akka-grpc:protoc-gen-akka-grpc", 32 ), 33 PluginName: "akka", 34 Configuration: plugintest.WithConfiguration( 35 plugintest.WithLabel(t, "@build_stack_rules_proto//plugin/akka/akka-grpc:protoc-gen-akka-grpc"), 36 plugintest.WithOutputs("test_akka_grpc.srcjar"), 37 ), 38 SkipIntegration: true, 39 }, 40 }) 41 }