google-research / raksha

Apache License 2.0
35 stars 17 forks source link

Write Tests for the ToString methods in auth_logic/ast.h and datalog/program.h #720

Open aferr opened 2 years ago

aferr commented 2 years ago

(Note that these ToString methods were previously called DebugPrint)

It turns out that DebugPrint was actually used to implement auth_logic_ast_traversing_visitor_test.cc and between me and Gogul we were not able to think of a way to re-implement this test without using strings within a reasonable timeframe (see also: this code).

Instead of deprecating this method, we should write tests for ToString. Then it's OK for tests to depend on it.

aferr commented 2 years ago

Consider also extending https://github.com/google-research/raksha/blob/main/src/ir/auth_logic/ast_string.h so that it can be used instead of these methods.