Re: [perl #38982] [CAGE] refactor long test files

2008-01-12 Thread Bernhard Schmalhofer

James Keenan via RT schrieb:

Hey, gang!  Can anyone comment on the status of this ticket?

I agree that if a test file is 2400 lines long, there's a prima facie
case for splitting it into smaller components.

However, based on my experience and ptc's in cage-cleaning, I'd
recommend opening up individual RTs for test files that would benefit
subdividing.  That way, we can more easily identify which test files
have been refactored and which remain to be done.
  
One of the problems with the Parrot-RT is that there are tickets that 
linger on

and nobody knows whether they can be closed.
So opening, and quickly resolving, small and specific tickets is a good 
idea.


I suggest to open specific tickets for each file that is a candidate for 
refactoring
and add it as a dependency of the meta ticket #38982. Once the 
dependencies are resolved,

the meta ticket can be resolved as well.

My 0.02 €
  Bernhard



[perl #38982] [CAGE] refactor long test files

2008-01-12 Thread James Keenan via RT
I have created RT tickets for 25 test files each of which is = 1000
lines in length.  The tickets ask you to examine the file to determine
whether it can reasonably be subdivided.  If so, subdivide; if not, take
and resolve the ticket.

 2907  t/op/string.t
 2649  t/pmc/nci.t
 2485  t/op/calling.t
 2083  t/pmc/objects.t
 1907  t/pmc/complex.t
 1720  t/pmc/namespace.t
 1477  t/pmc/sub.t
 1467  t/library/streams.t
 1450  t/pmc/mmd.t
 1433  t/pmc/iterator.t
 1433  t/pmc/hash.t
 1387  t/op/integer.t
 1381  t/pmc/resizablestringarray.t
 1372  t/pmc/string.t
 1274  t/op/jit.t
 1269  t/pmc/object-meths.t
 1251  t/op/lexicals.t
 1238  t/op/number.t
 1230  t/pmc/resizablepmcarray.t
 1206  t/op/cmp-nonbranch.t
 1154  t/pmc/float.t
 1151  t/pmc/threads.t
 1141  t/pmc/bigint.t

I excluded test directories such as t/configure/ and t/codingstd/ that
either ptc or I keep a close watch on.

Resolving this ticket.



[perl #38982] [CAGE] refactor long test files

2008-01-11 Thread James Keenan via RT
Hey, gang!  Can anyone comment on the status of this ticket?

I agree that if a test file is 2400 lines long, there's a prima facie
case for splitting it into smaller components.

However, based on my experience and ptc's in cage-cleaning, I'd
recommend opening up individual RTs for test files that would benefit
subdividing.  That way, we can more easily identify which test files
have been refactored and which remain to be done.

Comments?

kid51


Re: [perl #38982] [CAGE] refactor long test files

2008-01-11 Thread Paul Cochrane
James,

 However, based on my experience and ptc's in cage-cleaning, I'd
 recommend opening up individual RTs for test files that would benefit
 subdividing.  That way, we can more easily identify which test files
 have been refactored and which remain to be done.

Given the way we currently seem to interact with RT, I'd say open a
ticket on a test-file by test-file basis rather than having a blanket
ticket for the task.  This seems to have been working particularly
well for you recently, so I'd say resolve this ticket and open new
ones as relevant.

Paul


Re: [perl #38982] [CAGE] refactor long test files

2007-08-20 Thread David Romano
jerry gay wrote on Mon, Aug 20, 2007 at 07:17:07AM PDT:
 ...
 
 perhaps it's not explicit enough in the description, but
 Fsprintf_tests is copied directly from perl's repository. modifying
 this file is not recommended, as future synchronizations from a newer
 perl will likely overwrite previous parrot customizations. instead, i
 suggest t/op/sprintf.t be modified to handle multiple files, and a new
 file (perhaps Fsprintf_parrot) be created including the new test
 data.
Thanks, Jerry. I think it's explicit about it being copied, but I
didn't think of it being synchronized again. I have attached a new patch
which follows your suggestion and creates sprintf_parrot and adds it to
the files that t/op/sprint.t uses. I have also updated the
documentation. The patch must be applied after the rt38992-1.patch.

diffstat:
 t/op/sprintf.t  |   18 +-
 t/op/sprintf_parrot |   20 
 t/op/sprintf_tests  |   19 ---
 3 files changed, 33 insertions(+), 24 deletions(-)

- David

-- 
/All/ Christians -- 'that they all may be one' -- are to be one. It is
obvious that there can be no organizational unity which could include
all born-again Christians everywhere in the world. It is just not
possible.
-- Francis Schaeffer, The Mark of a Christian
diff --git a/t/op/sprintf.t b/t/op/sprintf.t
index f1e1878..62912dd 100644
--- a/t/op/sprintf.t
+++ b/t/op/sprintf.t
@@ -8,17 +8,24 @@ t/op/sprintf.t  -- sprintf tests
 
 =head1 DESCRIPTION
 
-These tests are based on sprintf tests from perl 5.9.4.
-
 Tests sprintf, excluding handling of 64-bit integers or long
 doubles (if supported), of machine-specific short and long
 integers, machine-specific floating point exceptions (infinity,
 not-a-number ...), of the effects of locale, and of features
 specific to multi-byte characters (under the utf8 pragma and such).
 
-Individual tests are stored in the Csprintf_tests file in the same
-directory; There is one test per line. In each test, there are three
-required fields:
+Individual tests are stored in either Csprintf_tests or Csprintf_parrot in
+the same directory. The tests in the Csprintf_tests file are based on
+sprintf tests from perl 5.9.4. Only change that file to synchronize with perl
+5.x.x releases. The tests in the Csprintf_parrot file are parrot-specific
+sprintf tests, and can be changed. Simply put, change Csprintf_parrot, not
+Csprintf_tests.
+
+=head2 Test file structure
+
+As stated above, individual tests are stored in either Csprintf_tests or
+Csprintf_parrot in the same directory; there is one test per line. In each
+test, there are three required fields:
 
 =over 4
 
@@ -88,6 +95,7 @@ tag 'all' is allowed for todo tests that should fail on any 
system
 
 # populate the list of test files
 push test_files, 'sprintf_tests'
+push test_files, 'sprintf_parrot'
 
 
 .local pmc file_iterator # iterate over list of files..
diff --git a/t/op/sprintf_parrot b/t/op/sprintf_parrot
new file mode 100644
index 000..cd96ff4
--- /dev/null
+++ b/t/op/sprintf_parrot
@@ -0,0 +1,20 @@
+Hello, %s\nParrot! Hello, Parrot!\nstring substitution w/chars 
before
+Hash[0x%x]\n   256 Hash[0x100]\n   hex format good
+Hash[0x%lx]\n  256 Hash[0x100]\n   long-hex format
+Hello, %.2s!\n Parrot  Hello, Pa!\ntruncated string sub w/chars before
+Hello, %Ss Hello, Pa!\nHello, Hello, Pa!\n
+1 == %Pd\n 1   1 == 1\ndec subst
+-255 == %vd\n  -255-255 == -255\n  signed (negative) dec subst
++123 == %+vd\n 123 +123 == +123\n  signed dec subst
+256 == %vu\n   256 256 == 256\nunsigned subst
+1 == %+vu\n1   1 == 1\nunsigned subst 2
+001 == %0.3u\n 1   001 == 001\nformatted unsigned subst
+001 == %+0.3u\n1   001 == 001\nformatted unsigned subst 2
+0.50 == %f\n   0.5 0.50 == 0.50\n  default float subst
+0.500 == %5.3f\n   0.5 0.500 == 0.500\nformatted float subst
+0.001 == %g\n  0.001   0.001 == 0.001\ndouble subst
+1e+06 == %g\n  1.0e6   1e+06 == 1e+06\ndouble subst
+0.5 == %3.3g\n 0.5 0.5 == 0.5\nformatted double subst
+%% == %%\n 0   % == %\nno subst
+That's all, %s\n   folks!  That's all, folks!\n
+
diff --git a/t/op/sprintf_tests b/t/op/sprintf_tests
index 0baf56c..322fcec 100644
--- a/t/op/sprintf_tests
+++ b/t/op/sprintf_tests
@@ -307,24 +307,5 @@
 %#x0   0
 %2147483647$v2d''  
 %*2147483647$v2d   ''   UNINIT
-Hello, %s\nParrot! Hello, Parrot!\nstring substitution w/chars 
before
-Hash[0x%x]\n   256 Hash[0x100]\n   hex format good
-Hash[0x%lx]\n  256 Hash[0x100]\n   long-hex format
-Hello, %.2s!\n Parrot  Hello, Pa!\ntruncated string sub w/chars before
-Hello, %Ss Hello, Pa!\nHello, Hello, Pa!\n
-1 == %Pd\n 1   1 == 1\ndec subst
--255 == %vd\n  -255-255 == -255\n  signed (negative) dec subst
-+123 == %+vd\n 123 +123 == 

Re: [perl #38982] [CAGE] refactor long test files

2007-08-19 Thread Andy Lester


On Aug 19, 2007, at 7:15 PM, David Romano wrote:

The patch splits string.t (originally almost 3000 lines) into  
different

files, as well as moves some of the tests for sprintf into
t/op/sprintf_tests.


Why is this a good thing, to be splitting up the files like this?  I  
can see sprintf getting their own, but why is 3000 lines a bad thing?


xoa

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: [perl #38982] [CAGE] refactor long test files

2007-08-19 Thread Mark Glines
On Sun, 19 Aug 2007 19:19:22 -0500
Andy Lester [EMAIL PROTECTED] wrote:

 
 On Aug 19, 2007, at 7:15 PM, David Romano wrote:
 
  The patch splits string.t (originally almost 3000 lines) into  
  different
  files, as well as moves some of the tests for sprintf into
  t/op/sprintf_tests.
 
 Why is this a good thing, to be splitting up the files like this?  I  
 can see sprintf getting their own, but why is 3000 lines a bad thing?

First thing that comes to mind, splitting it up associates the
individual tests with more descriptive filenames, which makes it
easier to see what broke at a glance.

My $0.02,

Mark