Make printers use singular noun for a single element
authorJonathan Wakely <jwakely@redhat.com>
Wed, 14 Dec 2016 16:07:29 +0000 (16:07 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 14 Dec 2016 16:07:29 +0000 (16:07 +0000)
commitd33c00e1ceb82fa46561ee076b9cb40ad44dc0dc
treec923fb7a40da6938459bdbe00266f38ccce2a7e9
parent3c760f4a79c221408122b3f265a8039b04ce697e
Make printers use singular noun for a single element

* python/libstdcxx/v6/printers.py (num_elements): New function.
(StdMapPrinter.to_string, StdSetPrinter.to_string)
(StdDequePrinter.to_string, Tr1UnorderedSetPrinter.to_string)
(Tr1UnorderedMapPrinter.to_string): Use num_elements.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected results
to use singular noun when there is only one element.
* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/tr1.cc: Likewise.

From-SVN: r243652
libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/debug.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/debug_cxx11.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/tr1.cc