[liblouis-liblouisxml] Re: Test Harness for liblouis

  • From: Mesar Hameed <mesar.hameed@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 29 Feb 2012 14:17:49 +0000

Hi Christian,

You are replying to an old message, somewhere along the line we seem to have 
got two threads for the 
harness discussion.

Looking back at the IRC logs, I thought we agreed that csv files would cause 
more trouble than worth, 
because we couldn't find a field seperator that could not potentially appear in 
the input, in which case it would have to be escaped etc.
At wich point you said you liked some format that ruby uses for its testing, 
which you were going to 
investigate and get back to me on.

Sorry if I missunderstood something.

Please see other thread for the patch that imports the python bindings from 
source rather than the installed once.

Thanks,
Mesar
On Wed 29/02/12,12:37, Christian Egli wrote:
> Hi all
> 
> Mesar Hameed <mesar.hameed@xxxxxxxxx> writes:
> > Please find attached patch that includes the updated harness.
> 
> Really cool stuff!
> 
> Mesar and I had a lengthy discussion in irc about the test harness. I
> prefer a simple format to express the tests. For complicated tests you
> can always use Python unit tests. I experimented with a csv file and the
> standard csv reader can easily parse these. An example test file is
> attached. We need to agree on a simple delimiter to separate fields
> which is unlikely to occur in the input data and in the output
> (otherwise all the data has to be quoted). The data can easily be parsed
> with the csv module and fed into the test harness like so:
> 
> import csv
> reader = csv.reader(open("foo.csv", "rb"), delimiter=',', 
> skipinitialspace=True)
> for row in reader: print row
> 

> # these tests are expressed in the style of a csv. Empty lines and lines 
> starting with '#' are ignored
> # the first row is the text input. The second row is the expected braille 
> output
> # the optional third row is a python dict to pass additional params
> 
> # check that "the" is correctly contracted
> the cat sat on the mat, ! cat sat on ! mat
> 
> # Checking "to" is contracted correctly and joined to next word.
> to the moon, 6! moon
> 
> # Check that "to" at end of line doesnt get contracted, and that "went" is 
> expanded when cursor is positioned within the word.
> you went to, y went to, {mode: louis.compbrlAtCursor, cursorPos: 4, 
> BRLCursorPos: 2}

> 
> > 1. should the expected braille be unicode braille chars, or is the
> > ascii-braille ok?
> 
> I would think that the expected braille should be ascii-braille. The
> users around here seem to like that best.
> 
> 
> -- 
> Christian Egli
> Swiss Library for the Blind, Visually Impaired and Print Disabled
> Grubenstrasse 12, CH-8045 Zürich, Switzerland
> 
> 
> -----
> Jetzt kostenlos eidgenoessische und kantonale Abstimmungsunterlagen aus 17 
> Kantonen
> zum Hoeren auf CD abonnieren: medienverlag@xxxxxx

For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: