-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
Background and Motivation
There are some places within our test code where there is syntactically inefficient code. Here are two examples:
- Initializing a
Vec<TestScalar>with
vec![TestScalar::from(1), TestScalar::from(2), ...], instead of
[1, 2, ...].map(TestScalar::from).into_iter().collect()or something similar.
Sometimes these vecs should be used as slices anyway, in which case the iter and collect steps aren't necessary. - Some files will have several very similar tests with only little variation but have no centralization of the common functionality. For example, look at the tests in
/src/base/database/table_test_accessor_test.rs. Each test starts with a very similar setup. That could be centralized in one utility function.
It would be very nice to reduce this unnecessary boilerplate code.
Changes Required
Reduction in unnecessary extra boilerplate code. This doesn't have to be restricted to test code, but that tends to be the area with a lot of unnecessary extra code. No need to restrict yourself to the two examples above. We generally like to keep macros out of our code base, but we'll consider it if you want to use a macro.
iajoiner, Dustin-Ray and varshith257
Metadata
Metadata
Assignees
Labels
No labels