Closed lukaseder closed 1 year ago
Perhaps we can parse the expected results with cypher-dsl and then format in the same style as the transpiler is configured?
Yes indeed, that would be more robust, and adds coverage to the cypher-dsl parser. Though it also assumes that the cypher-dsl supports all the features...
Not sure what you folk's thought are here, @jexp, @michael-simons, but I think it would be useful if the test suite wasn't whitespace sensitive. For example, I've added this test here: https://github.com/neo4j-contrib/sql2cypher/commit/b7b6925d88b91e70d3a257a61ea851b7c0befa71
I started formatting the input SQL, because the jOOQ parser doesn't care about it, and no assertion is run validating the input. However, the output has to be formatted exactly as it is, on a single line. Would be nice if we could focus on semantics only, in these tests, assuming that formatting tests are already implemented in Cypher DSL?
I.e. this should work as output:
The simplest implementation would just replace
"\\s+"
by" "
prior to asserting equality, but that would also replace things in string literals. Perhaps you have other ideas?