From e8a3530d5093e42902f5c42f63bbff40bb74de02 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 28 Jun 2006 14:36:23 +0000 Subject: new tests (001.phpt is just a rename from the older one) increases coverage from 20% to 70% --- ext/pspell/tests/001.phpt | 116 +++++++++++++++++++++++++++++++++++ ext/pspell/tests/002.phpt | 38 ++++++++++++ ext/pspell/tests/003.phpt | 39 ++++++++++++ ext/pspell/tests/004.phpt | 35 +++++++++++ ext/pspell/tests/005.phpt | 46 ++++++++++++++ ext/pspell/tests/01pspell_basic.phpt | 116 ----------------------------------- ext/pspell/tests/wordlist.txt | 5 ++ 7 files changed, 279 insertions(+), 116 deletions(-) create mode 100644 ext/pspell/tests/001.phpt create mode 100644 ext/pspell/tests/002.phpt create mode 100644 ext/pspell/tests/003.phpt create mode 100644 ext/pspell/tests/004.phpt create mode 100644 ext/pspell/tests/005.phpt delete mode 100644 ext/pspell/tests/01pspell_basic.phpt create mode 100644 ext/pspell/tests/wordlist.txt (limited to 'ext/pspell') diff --git a/ext/pspell/tests/001.phpt b/ext/pspell/tests/001.phpt new file mode 100644 index 0000000000..0a22352eef --- /dev/null +++ b/ext/pspell/tests/001.phpt @@ -0,0 +1,116 @@ +--TEST-- +pspell basic tests (warning: may fail with pspell/aspell < GNU Aspell 0.50.3) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +I : true +will : true +not : true +buy : true +this : true +record : true +it : true +is : true +scratched : true +Sorry : true +I : true +will : true +not : true +buy : true +this : true +record : true +it : true +is : true +scratched : true +Uh : true +no : true +no : true +no : true +This : true +is : true +a : true +tobacconists : true +Ah : true +I : true +will : true +not : true +buy : true +this : true +tobacconists : true +it : true +is : true +scratched : true +No : true +no : true +no : true +no : true +Tobacco : true +um : true +cigarettes : true +holds : true +up : true +a : true +pack : true +Ya : true +Seegarets : ..false +Possible spellings:%s,Regrets,%s,Cigarettes,%s +Ya : true +Uh : true +My : true +hovercraft : true +is : true +full : true +of : true +eels : true +Sorry : true +My : true +hovercraft : true +pantomimes : true +puffing : true +a : true +cigarette : true +is : true +full : true +of : true +eels : true +pretends : true +to : true +strike : true +a : true +match : true +Ahh : ..false +Possible spellings:%sAh,Aha,%s +matches : true diff --git a/ext/pspell/tests/002.phpt b/ext/pspell/tests/002.phpt new file mode 100644 index 0000000000..b736b4ee2f --- /dev/null +++ b/ext/pspell/tests/002.phpt @@ -0,0 +1,38 @@ +--TEST-- +pspell session +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: Wrong parameter count for pspell_check() in %s002.php on line 5 +NULL +bool(false) +bool(false) +bool(true) +bool(true) + +Notice: Object of class stdClass could not be converted to int in %s002.php on line 12 + +Warning: pspell_clear_session(): 1 is not a PSPELL result index in %s002.php on line 12 +bool(false) +bool(true) +bool(false) diff --git a/ext/pspell/tests/003.phpt b/ext/pspell/tests/003.phpt new file mode 100644 index 0000000000..7af81683f9 --- /dev/null +++ b/ext/pspell/tests/003.phpt @@ -0,0 +1,39 @@ +--TEST-- +pspell_config_ignore +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(false) + +Warning: pspell_new_config(): PSPELL couldn't open the dictionary. reason: The encoding "b0rked" is not known. This could also mean that the file "%sb0rked.dat" could not be opened for reading or does not exist. in %s003.php on line 9 + +Warning: pspell_check(): 0 is not a PSPELL result index in %s003.php on line 10 +bool(false) +--- +bool(true) +bool(true) +bool(true) diff --git a/ext/pspell/tests/004.phpt b/ext/pspell/tests/004.phpt new file mode 100644 index 0000000000..80602bce39 --- /dev/null +++ b/ext/pspell/tests/004.phpt @@ -0,0 +1,35 @@ +--TEST-- +pspell configs +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(false) +--- +bool(true) +bool(true) +bool(true) diff --git a/ext/pspell/tests/005.phpt b/ext/pspell/tests/005.phpt new file mode 100644 index 0000000000..8aeb206031 --- /dev/null +++ b/ext/pspell/tests/005.phpt @@ -0,0 +1,46 @@ +--TEST-- +pspell configs +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: pspell_new_personal(): PSPELL couldn't open the dictionary. reason: The file "%s005.php" is not in the proper format. in %s005.php on line 5 +bool(false) +bool(true) +-- +bool(true) +bool(false) +bool(true) +bool(true) +-- +bool(true) +bool(true) diff --git a/ext/pspell/tests/01pspell_basic.phpt b/ext/pspell/tests/01pspell_basic.phpt deleted file mode 100644 index 1cfb684485..0000000000 --- a/ext/pspell/tests/01pspell_basic.phpt +++ /dev/null @@ -1,116 +0,0 @@ ---TEST-- -pspell basic tests (warning: may fail with pspell/aspell < GNU Aspell 0.50.3) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -I : true -will : true -not : true -buy : true -this : true -record : true -it : true -is : true -scratched : true -Sorry : true -I : true -will : true -not : true -buy : true -this : true -record : true -it : true -is : true -scratched : true -Uh : true -no : true -no : true -no : true -This : true -is : true -a : true -tobacconists : true -Ah : true -I : true -will : true -not : true -buy : true -this : true -tobacconists : true -it : true -is : true -scratched : true -No : true -no : true -no : true -no : true -Tobacco : true -um : true -cigarettes : true -holds : true -up : true -a : true -pack : true -Ya : true -Seegarets : ..false -Possible spellings:%s,Regrets,%s,Cigarettes,%s -Ya : true -Uh : true -My : true -hovercraft : true -is : true -full : true -of : true -eels : true -Sorry : true -My : true -hovercraft : true -pantomimes : true -puffing : true -a : true -cigarette : true -is : true -full : true -of : true -eels : true -pretends : true -to : true -strike : true -a : true -match : true -Ahh : ..false -Possible spellings:%sAh,Aha,%s -matches : true diff --git a/ext/pspell/tests/wordlist.txt b/ext/pspell/tests/wordlist.txt new file mode 100644 index 0000000000..e9d8da7ca3 --- /dev/null +++ b/ext/pspell/tests/wordlist.txt @@ -0,0 +1,5 @@ +personal_ws-1.1 en 4 +dfnvnsafksfksf +fg +iufrsn +jsksjfsjf -- cgit v1.2.1