Details
Diff Detail
Event Timeline
unittests/Format/CleanupTest.cpp | ||
---|---|---|
140 | Seems like it's worth to pull out a function getting (offset, input, expected output) and then doing all this. Of course doesn't *have* to be in this patch, but I guess now is as good a time as any. Once that is done and we don't need to duplicate so much code, I think it might be worth duplicating this test to have it with and without trailing comma. Also, I think there is actually a FIXME here. Lets assume I mark the offset that you put into ranges as X, then I think:
Does that make sense? |
- Refactored cleanup unittest; added more test cases for trailing commas.
unittests/Format/CleanupTest.cpp | ||
---|---|---|
140 | Yep, make sense :) |
Some remarks, but looks good.
unittests/Format/CleanupTest.cpp | ||
---|---|---|
38 | I thin we normally just used "unsigned" instead of "unsigned int". | |
39 | nit: alignment. | |
125 | I think for such short test cases, at least, I'd just inline the string literals, e.g.: EXPECT_EQ("class A {\nA() {} };", cleanupAroundOffsets({17, 19}, "class A {\nA() : , {} };")); But not sure whether it's better. |
- Minor cleanup.
unittests/Format/CleanupTest.cpp | ||
---|---|---|
125 | I prefer defining variables since it is easier to read/compare and also consistent with other test cases. |
I thin we normally just used "unsigned" instead of "unsigned int".