[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] ISO Modula-2 text filter examples available now on Google Code

From: Carl Glassberg
Subject: Re: [Gm2] ISO Modula-2 text filter examples available now on Google Code
Date: Thu, 11 Apr 2013 19:05:40 -0700 (PDT)


I have renamed 2 of the text-filters:

  ISOFilter3 is renamed: ShowEOL;
  ISOFilter10 is renamed: CharToOctal

I have finished creating a "regression test" version of 1 of the text-filters, 
not yet posted to Google Code.

But you should be aware of the following:

1) I am only using RawIO.Read (not RawIO.Write). Writing will be in text mode 

2) The output file must not already exist or the program terminates
with error msg: "Error: failed to create (new) file for output: "...

3) The "regression test" program is also a console-application but, unlike a 
text-filter, it is interactive. It is definitely not a "text-filter" in the 
sense discussed in "The Unix Programming Environment" (KERNIGHAN & PIKE) 
(section on text-filters). The text-filter examples use stdin/stdout and O/S 
redirection and, if there are command line arguments, they are only input 
filenames (never output filenames).

4) Filenames (both input and output) are interactively prompted-for and the 
program loops until the user hits <Enter> to exit or a file open or create 
fails. This "feature" will allow more than one set of input/output filenames to 
be processed by the same program, if desired, without having to retype the 
command to run it again.

I am probably forgetting some point or another...

So far I have successfully created one "regression test" version and it seems 
to work ok subject to the above (4) limitations.

Let me know if the above items 1) to 4) are acceptable in a "regression test" 
program that you can use.

The "regression test" version should still produce the same output as the 
text-filter version given the same text-file input, even if the design has to 
be different due to the RawIO.

I do really appreciate your feedback on the text filter project.

Are you in Canada?
I am in San Diego.

Carl Glassberg

--- On Wed, 4/10/13, john o goyo <address@hidden> wrote:

> From: john o goyo <address@hidden>
> Subject: Re: ISO Modula-2 text filter examples available now on Google Code
> To: "Carl Glassberg" <address@hidden>
> Cc: "GNU Modula-2" <address@hidden>
> Date: Wednesday, April 10, 2013, 7:35 AM
> Greetings:
> On 6-Apr-13, at 7:01 PM, Carl Glassberg wrote:
> > Hello:
> > 
> > I have been trying out some tests on the text filter
> programs using the following operating system commands,
> available on the Unix-like Mac OS X and therefore I assume
> available on most other Unix-like systems (Linux, BSD,
> etc.)
> Excuse me for being pedantic but OS X is UNIX.  (Vide
> > [...]
> > I prefer a testing solution that allows the user to
> create his own test text files and use the above operating
> system commands to compare input to output:
> > 
> > If filter1 reverses the effects of filter0, then you
> can do:
> > 
> > filter0 < fn1 > fn2
> > filter1 < fn2 > fn3
> > diff -s fn1 fn3
> > 
> > "diff" should give an "identical files" message
> although one may need to account for white-space
> differences. Also filter0 and filter1 may not be exact
> inverses of each other.
> > 
> > I have been doing those sorts of tests.
> > 
> > The end-of-line conversion scripts using "perl" (or the
> equivalent) are useful for determining if the filters are
> handling end-of-line as expected.
> > 
> > In addition, tests should be performed on 0 length
> files, files with various quantities of blank lines, blank
> lines with leading and trailing white-space, files with a
> final eol mark immediately preceding the physical
> end-of-file and those without such a final eol, and so on.
> > 
> > Would this testing solution be ok?
> Thank you for your notes on testing.  I was suggesting
> an ISO-Modula pogramme that would produce before- and
> correct
> after-filtering files (using the RawIO functions). 
> This would act as a regression test as one can compare with
> known results.
> So if the regression test produced files, filtertest1.before
> filtertest1.after and so on, you would run the filter on
> filtertest1.before
> and compare the output with filtertest1.after, and so on.
> Thank you for considering this.
> john
> > 
> > I would supply a Wiki page specifying the commands to
> type into the console and any other steps needed to perform
> the tests.
> > 
> > I don't plan to automate the testing because there are
> too many variables(what Modula2 is running under what O/S).
> > 
> > Sincerely
> > Carl Glassberg
> > ---
> > 
> > 
> > --- On Thu, 4/4/13, john o goyo <address@hidden>
> wrote:
> > 
> >> From: john o goyo <address@hidden>
> >> Subject: Re: ISO Modula-2 text filter examples
> available now on Google Code
> >> To: "Carl Glassberg" <address@hidden>
> >> Cc: "GNU Modula-2" <address@hidden>
> >> Date: Thursday, April 4, 2013, 6:08 AM
> >> Greetings:
> >> 
> >> On 2-Apr-13, at 9:45 AM, Carl Glassberg wrote:
> >>> Hello:
> >>> 
> >>> Until I can figure out how to upload, you will
> need to
> >> go to the Wiki pages for the project.
> >> 
> >> Your source compiles cleanly with gm2 on
> >> Solaris-sparc.  It would be most helpful if
> you wrote a
> >> programme to produce test files (before and after
> >> filtering).
> >> 
> >> john
> >> 
> > 
> > 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]