zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: PATCH: fix tests
Date: Sat, 20 Jun 2015 19:52:09 +0100	[thread overview]
Message-ID: <20150620195209.3dca8105@ntlworld.com> (raw)

All tests now passing on the typeset-array branch.

pws

diff --git a/Src/builtin.c b/Src/builtin.c
index 6cccf53..5eb7bfb 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -443,6 +443,28 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn)
 	        fputc(' ', xtrerr);
 	        quotedzputs(*fullargv++, xtrerr);
 	    }
+	    if (assigns) {
+		LinkNode node;
+		for (node = firstnode(assigns); node; incnode(node)) {
+		    Asgment asg = (Asgment)node;
+		    fputc(' ', xtrerr);
+		    quotedzputs(asg->name, xtrerr);
+		    if (asg->is_array) {
+			LinkNode arrnode;
+			fprintf(xtrerr, "=(");
+			for (arrnode = firstnode(asg->value.array);
+			     arrnode;
+			     incnode(arrnode)) {
+			    fputc(' ', xtrerr);
+			    quotedzputs((char *)getdata(arrnode), xtrerr);
+			}
+			fprintf(xtrerr, " )");
+		    } else if (asg->value.scalar) {
+			fputc('=', xtrerr);
+			quotedzputs(asg->value.scalar, xtrerr);
+		    }
+		}
+	    }
 	    fputc('\n', xtrerr);
 	    fflush(xtrerr);
 	}
diff --git a/Src/exec.c b/Src/exec.c
index 967f86e..6066d55 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3488,7 +3488,6 @@ execcmd(Estate state, int input, int output, int how, int last1)
 			wordcode ac = *state->pc++;
 			char *name = ecgetstr(state, EC_DUPTOK, &htok);
 			Asgment asg;
-			int htok;
 			local_list1(svl);
 
 			DPUTS(wc_code(ac) != WC_ASSIGN,
diff --git a/Test/D01prompt.ztst b/Test/D01prompt.ztst
index 3074efe..2638e24 100644
--- a/Test/D01prompt.ztst
+++ b/Test/D01prompt.ztst
@@ -199,5 +199,5 @@
 ?+zsh_directory_name:4> [[ d == n ]]
 ?+zsh_directory_name:12> [[ <parent>/very_long_directory_name == (#b)(*)/very_long_directory_name ]]
 ?+zsh_directory_name:14> return 0
-?+fn:7> local 'd=~[<parent>:l]'
+?+fn:7> local d='~[<parent>:l]'
 ?+fn:8> print '~[<parent>:l]'
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index d64f7ac..ca3f06c 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -570,6 +570,15 @@
 >unset
 >globassign
 
+  # This test is now somewhat artificial as
+  # KSH_TYPESET only applies to the builtin
+  # interface.  Tests to the more standard
+  # reserved word interface appear elsewhere.
+  (
+  # reserved words are handled during parsing,
+  # hence eval...
+  disable -r typeset
+  eval '
   setopt kshtypeset
   ktvars=(ktv1 ktv2)
   typeset ktfoo=`echo arg1 arg2` $ktvars
@@ -580,6 +589,8 @@
   print $noktfoo
   print $+noktarg1 $+noktarg2
   unset ktfoo ktv1 ktv2 noktfoo noktarg2
+  '
+  )
 0:KSH_TYPESET option
 >1 1 0
 >arg1 arg2


                 reply	other threads:[~2015-06-20 18:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150620195209.3dca8105@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).