refactor tests to use static files, to ease development #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I found the tests using base64 encoded p12 data, was difficult to use / verify with e.g. openssl.
This refactoring uses regular files instead, which then can be analysed / verified by any developer straight and easier than before.
Additionally, I did rework the repetitive test code for the AESCBC128,192,256 into a table test, which makes the code more compact. Also the other three test function use embedded
t.Run()
logic, which is easier to read in the result/log (in case one runs the tests, the embedded test structure of the for-loop is then visible and easier to read.Any feedback welcome