Alternate Perl Implementation


BrianIngerson has developed an alternative implementation of Fit in the Perl programming language. The sourcecode can be found at:

This implementation has the same spirit as Ward's but was written from scratch view a Perl (and my personal) point of view.

Note: this version is also being ported to AlternatePythonImplementation and AlternateRubyImplementation for the YamlImplementationTestSuite

The class involved are:

  • Test::FIT - Runner functions
  • Test::FIT::Document - A test document class that parses and rebuilds the html. Contains table objects.
  • Test::FIT::Table - A table abstraction class.
  • Test::FIT::Cell - A table cell class
  • Test::FIT::Fixture - Fixture base class
  • Text::FIT::ColumnFixture - Column Oriented Processing
  • Text::FIT::ActionFixture - (in progress)
  • Text::FIT::RowFixture - (in progress)

One interesting part is how the html gets parsed in one regexp split:

    @parts = split m#(</?(?:table|tr|td)\b.*?>)#si, $html;

Another difference is how fixture processing is handled. The alternative implementation makes no distinction between attributes and methods. A cell is either a class, a method, or an argument. If a method wants to set an attribute, fine.

Also a method call determines whether it wants to be a test (pass, fail, except, ignore) or not (do nothing).

See it in action at PerlTypeIssues

 

Last edited April 21, 2003
Return to WelcomeVisitors