summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-01-21 15:28:51 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-01-22 00:13:35 +0100
commit32530f0e50ba5cd4e3259f8f1868e28ae375ef20 (patch)
tree6881ac69392cdb55698d38d3792d3c6dc269fdb5 /test
parent31b4c71eb2610471cb0598338f510633f407477f (diff)
downloadcalcurse-32530f0e50ba5cd4e3259f8f1868e28ae375ef20.tar.gz
calcurse-32530f0e50ba5cd4e3259f8f1868e28ae375ef20.zip
test/: Add generic tests for todo operations
* todo-001.sh: Tests the "-t" command line option (calculates expected output by parsing the todo data file). * todo-002.sh: Tests "-t<num>" in a way similar to todo-001.sh. * todo-003.sh: Tests "-t0" in a way similar to todo-001.sh. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am5
-rw-r--r--test/data/todo197
-rwxr-xr-xtest/todo-001.sh12
-rwxr-xr-xtest/todo-002.sh10
-rwxr-xr-xtest/todo-003.sh12
5 files changed, 235 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index a478a8b..d98c727 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -3,7 +3,10 @@ AUTOMAKE_OPTIONS = foreign
TESTS = \
true-001.sh \
run-test-001.sh \
- run-test-002.sh
+ run-test-002.sh \
+ todo-001.sh \
+ todo-002.sh \
+ todo-003.sh
check_PROGRAMS = run-test
check_SCRIPTS = $(TESTS)
diff --git a/test/data/todo b/test/data/todo
new file mode 100644
index 0000000..6f1c0e0
--- /dev/null
+++ b/test/data/todo
@@ -0,0 +1,197 @@
+[7] Wheeling predictor aggrieve dentist's vegetable
+[-8] Stine's Napier's
+[9] Gloriously slams
+[-6] Reigning
+[5] Television
+[3] Aladdin ancestoring matzohs
+[-8] Holloway's turnip's
+[1] Nary parabled Louvre's fleetest mered
+[-7] Josef heir's flake
+[-4] Spins Mondrian's velveteen
+[-7] Phone's backrest's
+[2] Surgical handlers fodder Crimea
+[-1] Finality surging studentship inversely terry
+[-3] Knitwear's cruet
+[-6] Scalper board coalescence's speedsters Tabatha's
+[6] Apprehend domino Olivier's
+[7] Acid bicepses magnetizing Trotsky's
+[-9] Tugboat warrantying
+[4] Restrictive Gresham clinch thunderhead
+[1] Stench's approximates torus's gymnast's
+[-5] Sixteen's
+[-6] Pear bauble clemency's heartbreaks compresses
+[-8] Bytes asters
+[2] Freebasing Oppenheimer
+[8] Secessionists Keogh's
+[-6] Mass analog's Pharaoh's sensationalists
+[-7] Dissidence
+[4] Unbuttoned horsemen beggar's commander Griffin
+[-6] Computations Yangtze slowpokes sourly bearskin's
+[2] Finesses Sebastian's nightclubbed
+[6] Rectangle mascots examiner blah screechy
+[-3] Electrolyte equities infrastructure's
+[2] Daydreamed
+[5] Globed
+[-2] Stores shamefaced slithering
+[5] Reverend
+[7] Proposed trespassed Bultmann
+[3] Maui
+[7] Restarts poisoner's Patterson's bucktooth
+[3] Dislodged washboard inhabitant's
+[5] Unsafer ingenuousness's supine
+[-4] Ripeness's nirvana
+[-7] Invigorating desserts copy's abbé
+[-5] Shorthorns straddle carbons
+[6] Lading
+[-2] Drawling secretary's
+[6] Ransom tablet
+[3] Unbarring
+[1] Uncorks aggression's Charmaine
+[-1] Donor's mummers dunning
+[-4] Leafiest tomcats crematoria Teletypes quires
+[-7] Koshered numismatics's
+[3] Wavelet's anapests flan
+[8] Stroke farmyard's deterrent urned
+[-6] Gunsmiths
+[8] Chileans smirk footholds
+[4] Erasmus pawnshop unmasked Andromache transgression's
+[4] Heighten squirted
+[-7] Hoodwinks Hector Playboy's fizzy
+[1] Fillmore's ricks Federico kiloton's steamy
+[5] Thor songwriters hookup
+[-1] Chatty
+[-6] Insensitivity shrill vainly Schindler's installs
+[1] Originality channeled romantically
+[-2] Advil
+[9] Beefburger's
+[2] Chorals incurred rediscovery's dioxide's firstly
+[8] Designed breach salarying
+[1] Phantom's Tagore
+[-4] Harriet worlds
+[5] Thereby
+[-2] Edgewise
+[8] Pleasanter
+[1] Kindness redundant
+[5] Soto's thrones tracing's
+[-2] Jenner's cymbal's
+[8] Surreals Zachery demonstrative athlete's
+[-9] Roommate
+[-1] Amening Hofstadter's excellently
+[-4] Refining wildest
+[2] Sudan's Ger's
+[3] Yukon's expletives
+[6] Cox foretold electroencephalogram gargoyle individualizing
+[6] Speedier buzzer Natalia
+[2] Sphinx telepathy's
+[1] Nahum run debauches chambers
+[-7] Extortion cacophonies
+[4] Maharajas
+[3] Virtuosi incompatible
+[7] Timex's Semarang undercarriage gladiator
+[-6] Meditates choreographing
+[-2] Indianapolis career
+[-8] Sensuality's pushover's bookkeeper's democrat's Establishment's
+[-7] Sputtering Liz gentle
+[8] Consonances wounding petties confessors blaze's
+[-8] Pentateuch's acquiting clumsiest
+[4] Angstrom
+[7] Watson sepsis's depoliticizing wried La's
+[-6] Terrapins
+[9] Seasons
+[-5] Bumpier drolly Sallust maws
+[1] Overstayed
+[-9] Sheer
+[6] Arrayed jewelling
+[8] Distrusted crinkly tels
+[8] Wilier allegro dine dead
+[-3] Sores brokerage prerecorded Clifton's
+[8] Anyone Rowena's rumbled
+[-1] Chairlift's abstruse Baikal mattresses dowry's
+[5] Diaz's disrespected washtub's
+[6] Eisner's conditioning
+[-7] Ape's
+[-9] Flirts provocative Liechtenstein mozzarella butterfat's
+[3] Homeopathy triennials potteries ovoid
+[2] Perpetrators hypnotize Iliad's personalizes dike
+[5] Olympia's Esperanto's
+[2] Receptors instil unripe
+[7] Groggier
+[-9] Journalists
+[-8] Creator
+[2] Brownsville
+[-2] Breadwinner sulfides
+[-7] Canoe impenetrable scrolled
+[4] Figurehead's nurture
+[7] Colombia Brahe's Johnston's spectacle jailors
+[-5] Strawberries syllogism
+[-1] Skimping brotherliness underscoring provendered
+[-2] Augment Husserl's unselfishness apostle
+[-2] Angle manipulates
+[-8] Other attempts
+[-6] Cook's scouring eh perimeter tomahawked
+[1] Metropolises leg's ultimated inseminating minaret's
+[2] Streptomycin's characterization's mercies entry's montage
+[1] Hooky niggards
+[-8] Embroidered Burton's cleave
+[1] Sharon preponderances hostessing inimitable
+[8] Briefcase
+[-9] Sparta's reappraisals whiniest Jocasta's curator's
+[-9] Becalm careers carotids
+[4] Inundate
+[6] Butchery piling's infomercial
+[3] Delineated
+[5] Unfinished surfs
+[-8] Recourse's
+[-6] Airtight overshot contest's ostentation
+[8] Roadshow bit's confection pastors wenches
+[-2] Saussure unselfish
+[-3] Guy insulation's maria's
+[7] Observers
+[-2] Decomposition's registry inboards crowbars
+[-1] Dahomey's facilitation's
+[-8] Ehrlich laced countertenor's convergence's choices
+[-2] Crochet
+[1] Defiance's cliffhangers battery
+[6] Multiplex
+[6] Springfield directs framer's empties
+[-3] Blunderbuss's
+[-4] Flusters allegiance's
+[-5] Trawled
+[5] Carrousels Avalon's
+[7] Constantine's ladings
+[-1] Regencies requires monkeyshines pornographic
+[7] Trolling
+[1] Promontory's mutts silk disc's foot
+[8] Vibrating
+[-8] Homeyness hibernates sambas fierceness's
+[8] Noise's quadruplicating multimedia Lyell
+[3] Equilaterals shes minibuses nudity consolidates
+[6] Hernia coccyges Orlon's Nirenberg
+[-2] Soakings Armagnac sexuality's homelier pests
+[7] Peso chalk's abiding
+[-6] Portraiture littoral leavening
+[-9] Boatman fleetingly radiator
+[3] Sissy husks
+[-7] Swearers gauntlets deepness acclaims stimulate
+[-1] Comedown
+[-9] Jubal's
+[1] Town vigor alphabetical concluded
+[-2] Baroda gazpacho's jolliness resupplies
+[-9] Asked
+[3] Chandrasekhar's gunfire's Earp's
+[-3] Bickering's shorts eagerness
+[-6] Ambiances Gagarin's milksops gargle
+[-5] Rainforest rediscovered Bohemia
+[-3] Syntactics smokehouses downward Quirinal reoccupy
+[-9] Succored sweetbriers
+[-4] Profess dismemberment fly syndicate
+[-4] Billeting
+[-9] Streetwalker's
+[4] Haberdashery's rates tentative eBay's McCoy
+[-3] Al's butterflying ovulate recitatives lumbered
+[2] Eye treads Eng's Peron baize
+[3] Podded
+[-9] Plunderer heightened spindlier transiting
+[-7] Pared
+[-5] Blueprint's gemstone's ceremony anteater's
+[3] Quarters
diff --git a/test/todo-001.sh b/test/todo-001.sh
new file mode 100755
index 0000000..f607b30
--- /dev/null
+++ b/test/todo-001.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = 'actual' ]; then
+ calcurse -D data/ -t | sort
+elif [ "$1" = 'expected' ]; then
+ (
+ echo 'to do:'
+ sed '/^\[-/d; s/^\[\([0-9]\)\] \(.*\)/\1. \2/' data/todo
+ ) | sort
+else
+ ./run-test "$0"
+fi
diff --git a/test/todo-002.sh b/test/todo-002.sh
new file mode 100755
index 0000000..c2718a9
--- /dev/null
+++ b/test/todo-002.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "$1" = 'actual' ]; then
+ calcurse -D data/ -t3
+elif [ "$1" = 'expected' ]; then
+ echo 'to do:'
+ sed -n 's/^\[3\] \(.*\)/3. \1/p' data/todo
+else
+ ./run-test "$0"
+fi
diff --git a/test/todo-003.sh b/test/todo-003.sh
new file mode 100755
index 0000000..ecec032
--- /dev/null
+++ b/test/todo-003.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = 'actual' ]; then
+ calcurse -D data/ -t0 | sort -n
+elif [ "$1" = 'expected' ]; then
+ (
+ echo 'completed tasks:'
+ sed -n 's/^\[-\([0-9]\)\] \(.*\)/\1. \2/p' data/todo
+ ) | sort -n
+else
+ ./run-test "$0"
+fi