Re: [Monotone-devel] Question for Tim - testsuite.lua giant list

2006-07-04 Thread Timothy Brownawell
On Tue, 2006-07-04 at 10:26 -0700, Zack Weinberg wrote:
> Is the giant list of test cases in testsuite.lua there because there's
> no readdir() equivalent in Lua's standard library, or is there some
> better reason?

No, I could fairly easily add that. One reason is that it seems nice to
have the tests in a known order, with new tests added at the end. This
is so that a given test always gets the same number, because test
numbers can be nice for some things. (In particular, the newest test can
always be referred to as "-1", which is convenient for running it with
less typing.)

Another reason is that not everything in the tests/ directory is a test.
There are a couple of other files used by the tests (various hooks, and
the test keys), and also a directory tests/common/ with include files
for working with CVS or netsync. Although I suppose that wouldn't be a
problem if what we looked for was $TEST_DIR/*/__driver__.lua .

Tim




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Fwd: [Monotone-devel] Question for Tim - testsuite.lua giant list

2006-07-04 Thread Alex Queiroz

Hallo,

I should remember to click the "Reply to all" button...

-- Forwarded message --
From: Alex Queiroz <[EMAIL PROTECTED]>
Date: Jul 4, 2006 3:03 PM
Subject: Re: [Monotone-devel] Question for Tim - testsuite.lua giant list
To: Zack Weinberg <[EMAIL PROTECTED]>


Hallo,

On 7/4/06, Zack Weinberg <[EMAIL PROTECTED]> wrote:


If it's the former, does anyone object to my snarfing Steve Kemp's
lua-fs extension[1] into our local copy of the interpreter, and using
that to get rid of the giant list?  (Note I can see this being useful
for hooks too - it has other useful things like stat, chmod, mkdir -
which is why I suggest grabbing the whole thing rather than just the
readdir implementation.)



Reading the site I saw that this library is for Lua 5.0. Although
that's the version of Lua used by monotone, it would hold even more
the upgrade to Lua 5.1.1.
   I don't think an external library is necessary for this. Monotone
has already directory traversing for Windows and UNIX, it could be
easily exported to Lua as an interator function:

for file in direntries(dir) do ... end

--
-alex
http://www.ventonegro.org/


--
-alex
http://www.ventonegro.org/


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


[Monotone-devel] Question for Tim - testsuite.lua giant list

2006-07-04 Thread Zack Weinberg

Is the giant list of test cases in testsuite.lua there because there's
no readdir() equivalent in Lua's standard library, or is there some
better reason?

If it's the former, does anyone object to my snarfing Steve Kemp's
lua-fs extension[1] into our local copy of the interpreter, and using
that to get rid of the giant list?  (Note I can see this being useful
for hooks too - it has other useful things like stat, chmod, mkdir -
which is why I suggest grabbing the whole thing rather than just the
readdir implementation.)

zw

[1] http://www.steve.org.uk/Software/lua-fs/  It's LGPLed.


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel