[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] test defs: add subroutine for input unindenting
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH] test defs: add subroutine for input unindenting |
Date: |
Tue, 1 Mar 2011 10:40:27 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Tuesday 01 March 2011, Peter Rosin wrote:
> Den 2011-03-01 06:12 skrev Ralf Wildenhues:
> > * Peter Rosin wrote on Mon, Feb 28, 2011 at 10:01:35PM CET:
> >> Den 2011-02-28 21:36 skrev Ralf Wildenhues:
> >>> It would be nice your sed script would allow sed scripts like
> >>> s/#//
> >>> s/ #//
> >>>
> >>> to continue to work. But if they don't, for now, that's not a big
> >>> problem either: failures will be noisy.
> >>
> >> Implementing something that covers every corner case requires a
> >> complete sed parser. That's not viable of course, so that's
> >> obviously not what you mean.
> >
> > Right. I have no idea what we'll need in the end, but as I said:
> > failures will be noisy, so there is no problem in crossing that
> > bridge once we come to it.
> >
> >> How about:
> >>
> >> sed -e 's/ *# .*//'
> >
> > Fine with me.
>
> Good, I pushed with that squashed in. I didn't dare a merge to
> master as the conflicts looked scary.
>
I've taken a look and done the merge. Luckily, the conflicts were
in fact strictly spurious (but yes, they truly look scary if you're
not intimate with the latest changes in tests/defs, which indeed
entailed quite a bit of code moving; sorry about that).
I'd also like to enhance `self-check-unindent.test' to ensure that
`unindent' remains usable in parallel in the future. OK to commit
the patch below (to master)? I'll push in 72 hours if there is no
ob
jection.
Thanks,
Stefano
-*-*-
tests: extend check on 'unindent' shell function
* tests/self-check-unindent.test: Also check that multiple
instances of 'unindent' can run in parallel (this was not
the case when that function used temporary files).
---
ChangeLog | 7 +++++++
tests/self-check-unindent.test | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a624ea4..6caa396 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-01 Stefano Lattarini <address@hidden>
+
+ tests: extend check on 'unindent' shell function
+ * tests/self-check-unindent.test: Also check that multiple
+ instances of 'unindent' can run in parallel (this was not
+ the case when that function used temporary files).
+
2011-03-01 Peter Rosin <address@hidden>
test defs: unindent without temporary file
diff --git a/tests/self-check-unindent.test b/tests/self-check-unindent.test
index 4672683..3f7edd9 100755
--- a/tests/self-check-unindent.test
+++ b/tests/self-check-unindent.test
@@ -74,7 +74,9 @@ last line
END
unindent input > got
+diff exp got
+unindent input | unindent > got
diff exp got
#------------------------------------------------------------------
@@ -130,7 +132,9 @@ last line
END
unindent input > got
+diff exp got
+unindent input | unindent > got
diff exp got
#------------------------------------------------------------------
@@ -161,7 +165,9 @@ END
cp input exp
unindent input > got
+diff exp got
+unindent input | unindent > got
diff exp got
#------------------------------------------------------------------
@@ -185,7 +191,9 @@ bar
END
unindent input > got
+diff exp got
+unindent input | unindent > got
diff exp got
#------------------------------------------------------------------
@@ -209,9 +217,39 @@ bar
END
unindent input > got
+diff exp got
+unindent input | unindent > got
diff exp got
#------------------------------------------------------------------
+: More elaborated parallel use
+
+cat > input <<END
+ x
+ ${tab}y
+ z
+ ${tab}a
+ ${tab} b
+${tab}c
+ ${tab}d
+ ${tab}e
+ ${tab}${tab}f
+END
+
+cat > exp <<END
+y
+z
+a
+ b
+c
+ ${tab}d
+ ${tab}e
+${tab}f
+END
+
+unindent input | sed 1d | unindent > got
+diff exp got
+
:
--
1.7.2.3
- Re: [PATCH] test defs: add subroutine for input unindenting, Ralf Wildenhues, 2011/03/01
- Re: [PATCH] test defs: add subroutine for input unindenting, Peter Rosin, 2011/03/01
- Re: [PATCH] test defs: add subroutine for input unindenting,
Stefano Lattarini <=
- Re: [PATCH] test defs: add subroutine for input unindenting, Peter Rosin, 2011/03/01
- Re: [PATCH] test defs: add subroutine for input unindenting, Stefano Lattarini, 2011/03/01
- Re: [PATCH] test defs: add subroutine for input unindenting, Ralf Wildenhues, 2011/03/02
- Re: [PATCH] test defs: add subroutine for input unindenting, Stefano Lattarini, 2011/03/02