diff --git a/testdata/test7.proto b/testdata/test7.proto new file mode 100644 index 0000000..e40afcb --- /dev/null +++ b/testdata/test7.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package example; + +message Example { + string foo = 1; + string bar = 2; + string baz = 3; +} + +// Make sure that services are ignored. +service ExampleService { + rpc DoExample(Example) returns (Example); +} diff --git a/testdata/test7.rules b/testdata/test7.rules new file mode 100644 index 0000000..e446232 --- /dev/null +++ b/testdata/test7.rules @@ -0,0 +1,15 @@ +// @@START_GENERATED_FUNCTIONS@@ +function is_ExampleMessage(resource) { + return ((resource.keys().hasAll([]) && resource.size() == 0)) || + (resource.keys().hasAll(['foo']) && resource.size() == 1)) || + (resource.keys().hasAll(['bar']) && resource.size() == 1)) || + (resource.keys().hasAll(['baz']) && resource.size() == 1)) || + (resource.keys().hasAll(['bar','foo']) && resource.size() == 2)) || + (resource.keys().hasAll(['baz','foo']) && resource.size() == 2)) || + (resource.keys().hasAll(['baz','bar']) && resource.size() == 2)) || + (resource.keys().hasAll(['baz','bar','foo']) && resource.size() == 3))) && + ((resource.foo == null) || (resource.foo is string)) && + ((resource.bar == null) || (resource.bar is string)) && + ((resource.baz == null) || (resource.baz is string)); +} +// @@END_GENERATED_FUNCTIONS@@