diff --git a/MANIFEST.in b/MANIFEST.in index 1792155..a7ae8e1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include ez_setup.py *.txt recursive-include src *.pyx *.pxd *.pxi *.py *.cpp recursive-include src/ext *.* -recursive-include test *.* \ No newline at end of file +recursive-include tests *.* diff --git a/README.markdown b/README.markdown index c4f832d..621361f 100644 --- a/README.markdown +++ b/README.markdown @@ -65,24 +65,16 @@ $ pip install -U cchardet ```python # -*- coding: utf-8 -*- import cchardet as chardet -with open(r"test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f: +with open(r"tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f: msg = f.read() result = chardet.detect(msg) print(result) ``` -## Test - -```bash -$ pip install -U chardet nose -$ cd test -$ nosetests --nocapture tests.py -``` - ## Benchmark -code: [tests.TestCchardetSpeed](https://github.com/PyYoshi/cChardet/blob/master/test/tests.py#L468) +code: [tests.TestCchardetSpeed](https://github.com/PyYoshi/cChardet/blob/master/src/tests/bench.py) -sample: [test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt](https://github.com/PyYoshi/cChardet/blob/master/test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt) +sample: [tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt](https://github.com/PyYoshi/cChardet/blob/master/src/tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt) ### Performance: CPU: Intel Core i7 860 2.8GHz diff --git a/test/bench.py b/src/tests/bench.py similarity index 100% rename from test/bench.py rename to src/tests/bench.py diff --git a/test/tests.py b/src/tests/test.py similarity index 100% rename from test/tests.py rename to src/tests/test.py diff --git a/test/testdata/bg/ISO-8859-5/wikitop_bg_ISO-8859-5.txt b/src/tests/testdata/bg/ISO-8859-5/wikitop_bg_ISO-8859-5.txt similarity index 100% rename from test/testdata/bg/ISO-8859-5/wikitop_bg_ISO-8859-5.txt rename to src/tests/testdata/bg/ISO-8859-5/wikitop_bg_ISO-8859-5.txt diff --git a/test/testdata/bg/UTF-8/wikitop_bg_UTF-8.txt b/src/tests/testdata/bg/UTF-8/wikitop_bg_UTF-8.txt similarity index 100% rename from test/testdata/bg/UTF-8/wikitop_bg_UTF-8.txt rename to src/tests/testdata/bg/UTF-8/wikitop_bg_UTF-8.txt diff --git a/test/testdata/bg/WINDOWS-1251/wikitop_bg_WINDOWS-1251.txt b/src/tests/testdata/bg/WINDOWS-1251/wikitop_bg_WINDOWS-1251.txt similarity index 100% rename from test/testdata/bg/WINDOWS-1251/wikitop_bg_WINDOWS-1251.txt rename to src/tests/testdata/bg/WINDOWS-1251/wikitop_bg_WINDOWS-1251.txt diff --git a/test/testdata/cz/ISO-8859-2/wikitop_cz_ISO-8859-2.txt b/src/tests/testdata/cz/ISO-8859-2/wikitop_cz_ISO-8859-2.txt similarity index 100% rename from test/testdata/cz/ISO-8859-2/wikitop_cz_ISO-8859-2.txt rename to src/tests/testdata/cz/ISO-8859-2/wikitop_cz_ISO-8859-2.txt diff --git a/test/testdata/cz/UTF-8/wikitop_cz_UTF-8.txt b/src/tests/testdata/cz/UTF-8/wikitop_cz_UTF-8.txt similarity index 100% rename from test/testdata/cz/UTF-8/wikitop_cz_UTF-8.txt rename to src/tests/testdata/cz/UTF-8/wikitop_cz_UTF-8.txt diff --git a/test/testdata/de/UTF-8/wikitop_de_UTF-8.txt b/src/tests/testdata/de/UTF-8/wikitop_de_UTF-8.txt similarity index 100% rename from test/testdata/de/UTF-8/wikitop_de_UTF-8.txt rename to src/tests/testdata/de/UTF-8/wikitop_de_UTF-8.txt diff --git a/test/testdata/de/WINDOWS-1252/wikitop_de_WINDOWS-1252.txt b/src/tests/testdata/de/WINDOWS-1252/wikitop_de_WINDOWS-1252.txt similarity index 100% rename from test/testdata/de/WINDOWS-1252/wikitop_de_WINDOWS-1252.txt rename to src/tests/testdata/de/WINDOWS-1252/wikitop_de_WINDOWS-1252.txt diff --git a/test/testdata/dk/UTF-8/wikitop_dk_UTF-8.txt b/src/tests/testdata/dk/UTF-8/wikitop_dk_UTF-8.txt similarity index 100% rename from test/testdata/dk/UTF-8/wikitop_dk_UTF-8.txt rename to src/tests/testdata/dk/UTF-8/wikitop_dk_UTF-8.txt diff --git a/test/testdata/dk/WINDOWS-1252/wikitop_dk_WINDOWS-1252.txt b/src/tests/testdata/dk/WINDOWS-1252/wikitop_dk_WINDOWS-1252.txt similarity index 100% rename from test/testdata/dk/WINDOWS-1252/wikitop_dk_WINDOWS-1252.txt rename to src/tests/testdata/dk/WINDOWS-1252/wikitop_dk_WINDOWS-1252.txt diff --git a/test/testdata/el/.WINDOWS-1253/README b/src/tests/testdata/el/.WINDOWS-1253/README similarity index 100% rename from test/testdata/el/.WINDOWS-1253/README rename to src/tests/testdata/el/.WINDOWS-1253/README diff --git a/test/testdata/el/.WINDOWS-1253/wikitop_el_WINDOWS-1253.txt b/src/tests/testdata/el/.WINDOWS-1253/wikitop_el_WINDOWS-1253.txt similarity index 100% rename from test/testdata/el/.WINDOWS-1253/wikitop_el_WINDOWS-1253.txt rename to src/tests/testdata/el/.WINDOWS-1253/wikitop_el_WINDOWS-1253.txt diff --git a/test/testdata/el/ISO-8859-7/wikitop_el_ISO-8859-7.txt b/src/tests/testdata/el/ISO-8859-7/wikitop_el_ISO-8859-7.txt similarity index 100% rename from test/testdata/el/ISO-8859-7/wikitop_el_ISO-8859-7.txt rename to src/tests/testdata/el/ISO-8859-7/wikitop_el_ISO-8859-7.txt diff --git a/test/testdata/el/UTF-8/wikitop_el_UTF-8.txt b/src/tests/testdata/el/UTF-8/wikitop_el_UTF-8.txt similarity index 100% rename from test/testdata/el/UTF-8/wikitop_el_UTF-8.txt rename to src/tests/testdata/el/UTF-8/wikitop_el_UTF-8.txt diff --git a/test/testdata/en/UTF-8/wikitop_en_UTF-8.txt b/src/tests/testdata/en/UTF-8/wikitop_en_UTF-8.txt similarity index 100% rename from test/testdata/en/UTF-8/wikitop_en_UTF-8.txt rename to src/tests/testdata/en/UTF-8/wikitop_en_UTF-8.txt diff --git a/test/testdata/en/WINDOWS-1252/wikitop_en_WINDOWS-1252.txt b/src/tests/testdata/en/WINDOWS-1252/wikitop_en_WINDOWS-1252.txt similarity index 100% rename from test/testdata/en/WINDOWS-1252/wikitop_en_WINDOWS-1252.txt rename to src/tests/testdata/en/WINDOWS-1252/wikitop_en_WINDOWS-1252.txt diff --git a/test/testdata/es/UTF-8/wikitop_es_UTF-8.txt b/src/tests/testdata/es/UTF-8/wikitop_es_UTF-8.txt similarity index 100% rename from test/testdata/es/UTF-8/wikitop_es_UTF-8.txt rename to src/tests/testdata/es/UTF-8/wikitop_es_UTF-8.txt diff --git a/test/testdata/es/WINDOWS-1252/wikitop_es_WINDOWS-1252.txt b/src/tests/testdata/es/WINDOWS-1252/wikitop_es_WINDOWS-1252.txt similarity index 100% rename from test/testdata/es/WINDOWS-1252/wikitop_es_WINDOWS-1252.txt rename to src/tests/testdata/es/WINDOWS-1252/wikitop_es_WINDOWS-1252.txt diff --git a/test/testdata/fi/UTF-8/wikitop_fi_UTF-8.txt b/src/tests/testdata/fi/UTF-8/wikitop_fi_UTF-8.txt similarity index 100% rename from test/testdata/fi/UTF-8/wikitop_fi_UTF-8.txt rename to src/tests/testdata/fi/UTF-8/wikitop_fi_UTF-8.txt diff --git a/test/testdata/fi/WINDOWS-1252/wikitop_fi_WINDOWS-1252.txt b/src/tests/testdata/fi/WINDOWS-1252/wikitop_fi_WINDOWS-1252.txt similarity index 100% rename from test/testdata/fi/WINDOWS-1252/wikitop_fi_WINDOWS-1252.txt rename to src/tests/testdata/fi/WINDOWS-1252/wikitop_fi_WINDOWS-1252.txt diff --git a/test/testdata/fr/UTF-8/wikitop_fr_UTF-8.txt b/src/tests/testdata/fr/UTF-8/wikitop_fr_UTF-8.txt similarity index 100% rename from test/testdata/fr/UTF-8/wikitop_fr_UTF-8.txt rename to src/tests/testdata/fr/UTF-8/wikitop_fr_UTF-8.txt diff --git a/test/testdata/fr/WINDOWS-1252/wikitop_fr_WINDOWS-1252.txt b/src/tests/testdata/fr/WINDOWS-1252/wikitop_fr_WINDOWS-1252.txt similarity index 100% rename from test/testdata/fr/WINDOWS-1252/wikitop_fr_WINDOWS-1252.txt rename to src/tests/testdata/fr/WINDOWS-1252/wikitop_fr_WINDOWS-1252.txt diff --git a/test/testdata/he/UTF-8/wikitop_he_UTF-8.txt b/src/tests/testdata/he/UTF-8/wikitop_he_UTF-8.txt similarity index 100% rename from test/testdata/he/UTF-8/wikitop_he_UTF-8.txt rename to src/tests/testdata/he/UTF-8/wikitop_he_UTF-8.txt diff --git a/test/testdata/he/WINDOWS-1255/wikitop_he_WINDOWS-1255.txt b/src/tests/testdata/he/WINDOWS-1255/wikitop_he_WINDOWS-1255.txt similarity index 100% rename from test/testdata/he/WINDOWS-1255/wikitop_he_WINDOWS-1255.txt rename to src/tests/testdata/he/WINDOWS-1255/wikitop_he_WINDOWS-1255.txt diff --git a/test/testdata/hu/.WINDOWS-1250/wikitop_hu_WINDOWS-1250.txt b/src/tests/testdata/hu/.WINDOWS-1250/wikitop_hu_WINDOWS-1250.txt similarity index 100% rename from test/testdata/hu/.WINDOWS-1250/wikitop_hu_WINDOWS-1250.txt rename to src/tests/testdata/hu/.WINDOWS-1250/wikitop_hu_WINDOWS-1250.txt diff --git a/test/testdata/hu/ISO-8859-2/wikitop_hu_ISO-8859-2.txt b/src/tests/testdata/hu/ISO-8859-2/wikitop_hu_ISO-8859-2.txt similarity index 100% rename from test/testdata/hu/ISO-8859-2/wikitop_hu_ISO-8859-2.txt rename to src/tests/testdata/hu/ISO-8859-2/wikitop_hu_ISO-8859-2.txt diff --git a/test/testdata/hu/UTF-8/wikitop_hu_UTF-8.txt b/src/tests/testdata/hu/UTF-8/wikitop_hu_UTF-8.txt similarity index 100% rename from test/testdata/hu/UTF-8/wikitop_hu_UTF-8.txt rename to src/tests/testdata/hu/UTF-8/wikitop_hu_UTF-8.txt diff --git a/test/testdata/it/UTF-8/wikitop_it_UTF-8.txt b/src/tests/testdata/it/UTF-8/wikitop_it_UTF-8.txt similarity index 100% rename from test/testdata/it/UTF-8/wikitop_it_UTF-8.txt rename to src/tests/testdata/it/UTF-8/wikitop_it_UTF-8.txt diff --git a/test/testdata/it/WINDOWS-1252/wikitop_it_WINDOWS-1252.txt b/src/tests/testdata/it/WINDOWS-1252/wikitop_it_WINDOWS-1252.txt similarity index 100% rename from test/testdata/it/WINDOWS-1252/wikitop_it_WINDOWS-1252.txt rename to src/tests/testdata/it/WINDOWS-1252/wikitop_it_WINDOWS-1252.txt diff --git a/test/testdata/nl/UTF-8/wikitop_nl_UTF-8.txt b/src/tests/testdata/nl/UTF-8/wikitop_nl_UTF-8.txt similarity index 100% rename from test/testdata/nl/UTF-8/wikitop_nl_UTF-8.txt rename to src/tests/testdata/nl/UTF-8/wikitop_nl_UTF-8.txt diff --git a/test/testdata/nl/WINDOWS-1252/wikitop_nl_WINDOWS-1252.txt b/src/tests/testdata/nl/WINDOWS-1252/wikitop_nl_WINDOWS-1252.txt similarity index 100% rename from test/testdata/nl/WINDOWS-1252/wikitop_nl_WINDOWS-1252.txt rename to src/tests/testdata/nl/WINDOWS-1252/wikitop_nl_WINDOWS-1252.txt diff --git a/test/testdata/no/UTF-8/wikitop_no_UTF-8.txt b/src/tests/testdata/no/UTF-8/wikitop_no_UTF-8.txt similarity index 100% rename from test/testdata/no/UTF-8/wikitop_no_UTF-8.txt rename to src/tests/testdata/no/UTF-8/wikitop_no_UTF-8.txt diff --git a/test/testdata/no/WINDOWS-1252/wikitop_no_WINDOWS-1252.txt b/src/tests/testdata/no/WINDOWS-1252/wikitop_no_WINDOWS-1252.txt similarity index 100% rename from test/testdata/no/WINDOWS-1252/wikitop_no_WINDOWS-1252.txt rename to src/tests/testdata/no/WINDOWS-1252/wikitop_no_WINDOWS-1252.txt diff --git a/test/testdata/pl/ISO-8859-2/wikitop_pl_ISO-8859-2.txt b/src/tests/testdata/pl/ISO-8859-2/wikitop_pl_ISO-8859-2.txt similarity index 100% rename from test/testdata/pl/ISO-8859-2/wikitop_pl_ISO-8859-2.txt rename to src/tests/testdata/pl/ISO-8859-2/wikitop_pl_ISO-8859-2.txt diff --git a/test/testdata/pl/UTF-8/wikitop_pl_UTF-8.txt b/src/tests/testdata/pl/UTF-8/wikitop_pl_UTF-8.txt similarity index 100% rename from test/testdata/pl/UTF-8/wikitop_pl_UTF-8.txt rename to src/tests/testdata/pl/UTF-8/wikitop_pl_UTF-8.txt diff --git a/test/testdata/pt/UTF-8/wikitop_pt_UTF-8.txt b/src/tests/testdata/pt/UTF-8/wikitop_pt_UTF-8.txt similarity index 100% rename from test/testdata/pt/UTF-8/wikitop_pt_UTF-8.txt rename to src/tests/testdata/pt/UTF-8/wikitop_pt_UTF-8.txt diff --git a/test/testdata/pt/WINDOWS-1252/wikitop_pt_WINDOWS-1252.txt b/src/tests/testdata/pt/WINDOWS-1252/wikitop_pt_WINDOWS-1252.txt similarity index 100% rename from test/testdata/pt/WINDOWS-1252/wikitop_pt_WINDOWS-1252.txt rename to src/tests/testdata/pt/WINDOWS-1252/wikitop_pt_WINDOWS-1252.txt diff --git a/test/testdata/ru/IBM855/wikitop_ru_IBM855.txt b/src/tests/testdata/ru/IBM855/wikitop_ru_IBM855.txt similarity index 100% rename from test/testdata/ru/IBM855/wikitop_ru_IBM855.txt rename to src/tests/testdata/ru/IBM855/wikitop_ru_IBM855.txt diff --git a/test/testdata/ru/KOI8-R/wikitop_ru_KOI8-R.txt b/src/tests/testdata/ru/KOI8-R/wikitop_ru_KOI8-R.txt similarity index 100% rename from test/testdata/ru/KOI8-R/wikitop_ru_KOI8-R.txt rename to src/tests/testdata/ru/KOI8-R/wikitop_ru_KOI8-R.txt diff --git a/test/testdata/ru/UTF-8/wikitop_ru_UTF-8.txt b/src/tests/testdata/ru/UTF-8/wikitop_ru_UTF-8.txt similarity index 100% rename from test/testdata/ru/UTF-8/wikitop_ru_UTF-8.txt rename to src/tests/testdata/ru/UTF-8/wikitop_ru_UTF-8.txt diff --git a/test/testdata/ru/WINDOWS-1251/wikitop_ru_WINDOWS-1251.txt b/src/tests/testdata/ru/WINDOWS-1251/wikitop_ru_WINDOWS-1251.txt similarity index 100% rename from test/testdata/ru/WINDOWS-1251/wikitop_ru_WINDOWS-1251.txt rename to src/tests/testdata/ru/WINDOWS-1251/wikitop_ru_WINDOWS-1251.txt diff --git a/test/testdata/ru/X-MAC-CYRILLIC/wikitop_ru_MACCYRILLIC.txt b/src/tests/testdata/ru/X-MAC-CYRILLIC/wikitop_ru_MACCYRILLIC.txt similarity index 100% rename from test/testdata/ru/X-MAC-CYRILLIC/wikitop_ru_MACCYRILLIC.txt rename to src/tests/testdata/ru/X-MAC-CYRILLIC/wikitop_ru_MACCYRILLIC.txt diff --git a/test/testdata/se/UTF-8/wikitop_se_UTF-8.txt b/src/tests/testdata/se/UTF-8/wikitop_se_UTF-8.txt similarity index 100% rename from test/testdata/se/UTF-8/wikitop_se_UTF-8.txt rename to src/tests/testdata/se/UTF-8/wikitop_se_UTF-8.txt diff --git a/test/testdata/se/WINDOWS-1252/wikitop_se_WINDOWS-1252.txt b/src/tests/testdata/se/WINDOWS-1252/wikitop_se_WINDOWS-1252.txt similarity index 100% rename from test/testdata/se/WINDOWS-1252/wikitop_se_WINDOWS-1252.txt rename to src/tests/testdata/se/WINDOWS-1252/wikitop_se_WINDOWS-1252.txt diff --git a/test/testdata/th/TIS-620/utffool_th_TIS-620.txt b/src/tests/testdata/th/TIS-620/utffool_th_TIS-620.txt similarity index 100% rename from test/testdata/th/TIS-620/utffool_th_TIS-620.txt rename to src/tests/testdata/th/TIS-620/utffool_th_TIS-620.txt diff --git a/test/testdata/th/TIS-620/wikitop_th_TIS-620.txt b/src/tests/testdata/th/TIS-620/wikitop_th_TIS-620.txt similarity index 100% rename from test/testdata/th/TIS-620/wikitop_th_TIS-620.txt rename to src/tests/testdata/th/TIS-620/wikitop_th_TIS-620.txt diff --git a/test/testdata/th/UTF-8/wikitop_th_UTF-8.txt b/src/tests/testdata/th/UTF-8/wikitop_th_UTF-8.txt similarity index 100% rename from test/testdata/th/UTF-8/wikitop_th_UTF-8.txt rename to src/tests/testdata/th/UTF-8/wikitop_th_UTF-8.txt diff --git a/test/testdata/tr/ISO-8859-9/wikitop_tr_ISO-8859-9.txt b/src/tests/testdata/tr/ISO-8859-9/wikitop_tr_ISO-8859-9.txt similarity index 100% rename from test/testdata/tr/ISO-8859-9/wikitop_tr_ISO-8859-9.txt rename to src/tests/testdata/tr/ISO-8859-9/wikitop_tr_ISO-8859-9.txt diff --git a/test/testdata/tr/UTF-8/wikitop_tr_UTF-8.txt b/src/tests/testdata/tr/UTF-8/wikitop_tr_UTF-8.txt similarity index 100% rename from test/testdata/tr/UTF-8/wikitop_tr_UTF-8.txt rename to src/tests/testdata/tr/UTF-8/wikitop_tr_UTF-8.txt diff --git a/test/testdata/wikipediaJa_Japan_SJIS.txt b/src/tests/testdata/wikipediaJa_Japan_SJIS.txt similarity index 100% rename from test/testdata/wikipediaJa_Japan_SJIS.txt rename to src/tests/testdata/wikipediaJa_Japan_SJIS.txt diff --git a/test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt b/src/tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt similarity index 100% rename from test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt rename to src/tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt diff --git a/test/testdata/wikipediaTw_Japan_GB2312.txt b/src/tests/testdata/wikipediaTw_Japan_GB2312.txt similarity index 100% rename from test/testdata/wikipediaTw_Japan_GB2312.txt rename to src/tests/testdata/wikipediaTw_Japan_GB2312.txt diff --git a/test/testdata/wikipediaTw_One_Thousand_and_One_Nights_GB2312.txt b/src/tests/testdata/wikipediaTw_One_Thousand_and_One_Nights_GB2312.txt similarity index 100% rename from test/testdata/wikipediaTw_One_Thousand_and_One_Nights_GB2312.txt rename to src/tests/testdata/wikipediaTw_One_Thousand_and_One_Nights_GB2312.txt diff --git a/test/testdata/zh/GB18030/wikitop_zh_GB18030.txt b/src/tests/testdata/zh/GB18030/wikitop_zh_GB18030.txt similarity index 100% rename from test/testdata/zh/GB18030/wikitop_zh_GB18030.txt rename to src/tests/testdata/zh/GB18030/wikitop_zh_GB18030.txt diff --git a/test/testdata/zh/UTF-8/wikitop_zh_UTF-8.txt b/src/tests/testdata/zh/UTF-8/wikitop_zh_UTF-8.txt similarity index 100% rename from test/testdata/zh/UTF-8/wikitop_zh_UTF-8.txt rename to src/tests/testdata/zh/UTF-8/wikitop_zh_UTF-8.txt