[twill] [OpenCore Dev] Re: Twill/Flunc blocks

Ian Bicking ianb at colorstudy.com
Wed Oct 24 09:46:24 PDT 2007


Titus Brown wrote:
> On Fri, Oct 19, 2007 at 04:11:48PM -0500, Ian Bicking wrote:
> -> Just throwing an idea out for Twill/Flunc (Flunc is our test runner that 
> -> uses Twill).  Our basic problem: we need some higher-level constructs to 
> -> generalize our tests.  So what if we add Tcl style strings?
> 
> I've never heard of flunc - cool!

Ah, I thought the other guys had brought it up before.

> -> For people who don't know Tcl -- probably most of you -- it has a string 
> -> literal syntax that looks very much like a programming structure.  But 
> -> it's actually just a string literal syntax.
> 
> I actually wrote some large programs in Tcl, because of the whole Phil
> Greenspun/Arsdigita thingamajiggy.  That's more or less what got me into
> serious Web programming ;).
> 
> Anyway...

I asked about the quoting rules over on the pyparsing list, and started 
getting it into my mind that Twill should just be Tcl straight out. 
It's a nice DSLish system for a language, and Twill is just a subset of 
Tcl now.  But that might be too much of a digression.  I'd link the 
response, but SF archiving on that pyparsing list looks like its 
lagging.  Anyway, there was an answer to how {} might work there, though 
it involved fully parsing the subexpression.  Which might be fine -- I'm 
not sure if there's a reasonable way to handle nesting and strings and 
quoting with {} without parsing the contents.

> [ ... specific proposal elided ... ]
> 
> A more philosophical question for you: why aren't you using Python
> instead of "twill script"?  Is it for comprehension and authoring
> reasons?  My usual answer to people who want 'if' statements in twill is
> to suggest that they either write an extension function or just call
> twill from Python.
> 
> Not that I'm rejecting the idea, just curious!

It's mostly about how tests develop -- they often start off simple, and 
then if you want to expand it you don't want to have to jump to Python 
and move everything over.  This lets you move bits over to Python (the 
complicated control stuff) without abandoning the other parts of your tests.

The specific thing that made me think of this is when we started 
generating Twill code to test combinations of permissions and access 
levels in our app, and I think just a few higher-level constructs would 
be able to achieve the same thing.

-- 
Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org



More information about the twill mailing list