Loading
tor-netdoc: Refactor RelayPlatform tests
This refactors the RelayPlatform test to store the test vectors in an array and iterate over it, comparing it with the expected output. This is a lot better than the current version, where there is not just a lot of copy and pasted code but also some tests that only check for an okay value. Unfortunately, there is not an easy way to review this with --color-moved or something. Personally, I would recommend to review each original test vector (i.e. a line starting with `let p =` followed by a string literal) and verify that the exact same string literal is still present within the new test vector. Afterwards, verifying the assertion logic should be easy, as it is a one-liner.