Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
unittests/Format/CleanupTest.cpp | ||
---|---|---|
147 ↗ | (On Diff #71149) | 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 | ||
---|---|---|
147 ↗ | (On Diff #71149) | Yep, make sense :) |
Some remarks, but looks good.
unittests/Format/CleanupTest.cpp | ||
---|---|---|
38 ↗ | (On Diff #71158) | I thin we normally just used "unsigned" instead of "unsigned int". |
39 ↗ | (On Diff #71158) | nit: alignment. |
125 ↗ | (On Diff #71158) | 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 ↗ | (On Diff #71158) | I prefer defining variables since it is easier to read/compare and also consistent with other test cases. |