This is an archive of the discontinued LLVM Phabricator instance.

[SyntaxTree]: Use Annotations in tests to reduce noise
AbandonedPublic

Authored by eduucaldas on Aug 11 2020, 1:37 AM.

Details

Reviewers
gribozavr2

Diff Detail

Event Timeline

eduucaldas created this revision.Aug 11 2020, 1:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2020, 1:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eduucaldas requested review of this revision.Aug 11 2020, 1:37 AM

Use unsigned long in the loop index

A proposition, upon review I'll change other tests.

One concern is that we might lose coverage while reducing noise. But I'll take a look into that with calm when changing the tests.

clang/unittests/Tooling/Syntax/TreeTest.cpp
186–187

I just wanted to do a for( auto [range, dump]& : zip(AnnotatedRanges,TreeDumps))

Is indexed loop the way to go in C++?
And also I used 0u here because we make a comparison to std::vector::size_type, is there a less error-prone way of writing those loop indexes?

gribozavr2 added inline comments.Aug 11 2020, 2:17 AM
clang/unittests/Tooling/Syntax/TreeTest.cpp
186–187

Yes, I believe what you have now is indeed the best way.

Use annotations to reduce noise of expression tests

eduucaldas abandoned this revision.Aug 18 2020, 4:43 AM