Add more spellcheck selftests
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 15 Jun 2016 00:12:16 +0000 (00:12 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 15 Jun 2016 00:12:16 +0000 (00:12 +0000)
commitf254671f2f9a83843b7b77b496689791bdfdb4fe
treecf61ac3757fd5bfdcfc0f5e53278cd0e3d0606c1
parentee62e30213a72a93ebee9bfbadc3612cef175957
Add more spellcheck selftests

gcc/ChangeLog:
* selftest-run-tests.c (selftest::run_tests): Call
selftest::spellcheck_tree_c_tests.
* selftest.h (selftest::spellcheck_tree_c_tests): New decl.
* spellcheck-tree.c: Include selftest.h and stringpool.h.
(selftest::test_find_closest_identifier): New function.
(selftest::spellcheck_tree_c_tests): New function.
* spellcheck.c (selftest::test_find_closest_string): Verify that
the order of the vec does not affect the results for this case.
(selftest::test_data): New array.
(selftest::test_metric_conditions): New function.
(selftest::spellcheck_c_tests): Add a test of case-comparison.
Call selftest::test_metric_conditions.

From-SVN: r237466
gcc/ChangeLog
gcc/selftest-run-tests.c
gcc/selftest.h
gcc/spellcheck-tree.c
gcc/spellcheck.c