Skip to content

Commit

Permalink
Add a simple test to make sure RPC Services are ignored (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj authored Jan 27, 2018
1 parent cb8fb55 commit 12ad860
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions testdata/test7.proto
Original file line number Diff line number Diff line change
@@ -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);
}
15 changes: 15 additions & 0 deletions testdata/test7.rules
Original file line number Diff line number Diff line change
@@ -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@@

0 comments on commit 12ad860

Please sign in to comment.