This is an archive of the discontinued LLVM Phabricator instance.

[TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements
ClosedPublic

Authored by sivachandra on May 27 2015, 5:14 PM.

Diff Detail

Event Timeline

sivachandra retitled this revision from to [TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements.
sivachandra updated this object.
sivachandra edited the test plan for this revision. (Show Details)
sivachandra added reviewers: chaoren, clayborg, chying.
sivachandra added a subscriber: Unknown Object (MLST).

Update arg name of a function.

chaoren added inline comments.May 27 2015, 5:23 PM
test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
64–69

Could you please add a space after each comma for readability? It'd be even nicer if they're all lined up.

sivachandra added inline comments.May 27 2015, 5:29 PM
test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
64–69

I thought about it. If I add spaces here, would be odd if I do not add for lines 64 and 65. However, these lines are beyond the scope of this patch IMO.

That said, anything for an LGTM: Should I only update 66-69, or all of 64-69?

chaoren edited edge metadata.May 27 2015, 5:32 PM

I think it makes sense to update 64 and 65 as well.

sivachandra edited edge metadata.

Improve readability per review comments.

For reference, 23.2.5-6 of n3337:

the absolute order of elements in an unordered container is not specified

test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
66
'\[\d\] = 3','\[\d\] = 3','\[\d\] = 3'

It's kind of meaning less to have three of these now. But I can't think of a good way to assert 3 distinct matches.

67

Same problem here.

clayborg accepted this revision.May 27 2015, 5:46 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.May 27 2015, 5:46 PM
sivachandra edited edge metadata.

Take care of repeating patterns when printing multisets.

sivachandra closed this revision.May 27 2015, 6:21 PM
chaoren added inline comments.May 27 2015, 6:22 PM
test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
68
'\[\d\] = 3(\\n|.)+\[\d\] = 3(\\n|.)+\[\d\] = 3'

How about

`(\[\d\] = 3(\\n|.)+){3}`

Instead?

69
(\[\d\] = "is"(\\n|.)+){2}

instead of

\[\d\] = "is"(\\n|.)+\[\d\] = "is"