Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fg and bg tests
- X-seq: zsh-workers 42722
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers' list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: fg and bg tests
- Date: Wed, 25 Apr 2018 18:01:55 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180425170158euoutp027a4675baaccf6374af3030af925911cf~ovHzslCu51430414304euoutp02D
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524675718; bh=ISevOIdfsmeLfyxshxMpmTPDG6MOPZ9VplzMFCtIMhA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=QpKcSd1dYDvxoRsWTBUg2Fw00QITKdZh9Puvg1+Ig8qljq/zOTsYZyZEMjWnMGoLM MD87NZg84N/jqtLqn9Az4jf5e+Dmr0adzl/DoKawHGYJ1bTHSHFXVTA/aYrLLU6o// WN+m73GUDpLY/Bp9HTGd+24RmwiE2eCL5Qy8w8/8=
- In-reply-to: <20180425155647.3e897139@camnpupstephen.cam.scsc.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180425090941eucas1p187cf5d07341d2041c15e9947962f3bd9@eucas1p1.samsung.com> <20180424135944.64e73c62@camnpupstephen.cam.scsc.local> <20180425100940.31816d28@camnpupstephen.cam.scsc.local> <CAH+w=7bxJQN6bvGdGNmGrA7jDa9xJei+kQ_0X+0kxX9pR176Zg@mail.gmail.com> <20180425155647.3e897139@camnpupstephen.cam.scsc.local>
On Wed, 25 Apr 2018 15:56:47 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> I'm unlikely to find a simpler command that does direct user
> interaction and I'm not going to be doing remote debugging.
dc is even less verbose (and at least in the GNU version a bit more
helpful if there is an error) and it's even easier to change the
internal state and report, but still has the minimum level of user
interaction I need. So let's try that.
I assume everyone has dc but in any case it's easy to check that and
skip tests if necessary.
If I get "This doesn't work on my system<EOM>" reports on this I think
it will be time to back the tests off and give up on them as not portable.
Yet more fixes for pattern comparison failures.
pws
diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index 1ec0b8e..6d5a41f 100644
--- a/Test/W02jobs.ztst
+++ b/Test/W02jobs.ztst
@@ -192,52 +192,46 @@
*>\[1] ? kill*sleep*
zpty_start
- zpty_input $'ed 2>/dev/null\n=\n'
+ zpty_input $'dc 2>/dev/null\n1\np\n'
zpty_line
- zpty_input $'a\nstuff1\n.\nw tmpfile\nq\n'
+ zpty_input $'1\n+\np\nq\n'
zpty_stop
- cat tmpfile
- rm -f tmpfile
0:Sanity check of "ed" as foreground process
-*>0
-*>stuff1
-F:This test checks we can run the simple editor "ed" as a way of testing
+*>1
+*>2
+F:This test checks we can run the simple calculator dc as a way of testing
F:user interaction for later job control tests . The test itself is
F:trivial; its failure may simply indicate our test methodology does not
F:work on this system.
zpty_start
- zpty_input $'ed 2>/dev/null\n=\n'
+ zpty_input $'dc 2>/dev/null\n1\np\n'
zpty_line
zpty_input $'\C-z'
zpty_input 'fg'
- zpty_input $'a\nstuff2\n.\nw tmpfile\nq\n'
+ zpty_input $'1\n+\np\nq\n'
zpty_stop
- cat tmpfile
- rm -f tmpfile
0:Basic fg with subsequent user interaction
-*>0
-*>zsh:*(stopped|suspended)*ed*
-*>*continued*ed*
-*>stuff2
+*>1
+*>zsh:*(stopped|suspended)*dc*
+*>*continued*dc*
+*>2
zpty_start
- zpty_input $'ed 2>/dev/null\n=\n'
+ zpty_input $'dc 2>/dev/null\n1\np\n'
zpty_line
zpty_input $'\C-z'
zpty_input 'bg'
zpty_input 'fg'
- zpty_input $'a\nstuff3\n.\nw tmpfile\nq\n'
+ zpty_input $'1\n+\np\nq\n'
zpty_stop
- cat tmpfile
- rm -f tmpfile
0:bg and fg with user input
-*>0
-*>zsh:*(stopped|suspended)*ed*
-*>*continued*ed*
-*>*(stopped|suspended)*ed*
-*>*continued*ed*
-*>stuff3
+*>1
+*>zsh:*(stopped|suspended)*dc*
+*>*continued*dc*
+*>*(stopped|suspended)*dc*
+*>*continued*dc*
+*>2
%clean
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index 1a6a0b5..d835e0e 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -315,26 +315,25 @@ ZTST_diff() {
if (( diff_pat )); then
local -a diff_lines1 diff_lines2
- integer failed i l n
+ integer failed i l
local p
- diff_lines1=("${(f)$(<$argv[-2])}")
- diff_lines2=("${(f)$(<$argv[-1])}")
+ diff_lines1=("${(f@)$(<$argv[-2])}")
+ diff_lines2=("${(f@)$(<$argv[-1])}")
if (( ${#diff_lines1} != ${#diff_lines2} )); then
failed=1
+ print -r "Pattern match filead, line mismatch (${#diff_lines1}/${#diff_lines2}):"
else
for (( i = 1; i <= ${#diff_lines1}; i++ )); do
if [[ ${diff_lines2[i]} != ${~diff_lines1[i]} ]]; then
failed=1
+ print -r "Pattern match failed, line $i:"
break
fi
done
fi
if (( failed )); then
- print -r "Pattern match failed, line $i:"
- n=${#diff_lines1}
- (( ${#diff_lines2} > $n )) && n=${#diff_lines2}
- for (( l = 1; l <= n; ++l )); do
+ for (( l = 1; l <= ${#diff_lines1}; ++l )); do
if (( l == i )); then
p="-"
else
@@ -342,7 +341,7 @@ ZTST_diff() {
fi
print -r -- "$p<${diff_lines1[l]}"
done
- for (( l = 1; l <= n; ++l )); do
+ for (( l = 1; l <= ${#diff_lines2}; ++l )); do
if (( l == i )); then
p="+"
else
Messages sorted by:
Reverse Date,
Date,
Thread,
Author