From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "Manuel Presnitz" <mpy@gmx.net>, zsh-workers@zsh.org
Subject: Re: zsh 5.1.1-test-1
Date: Sun, 22 Nov 2015 16:52:04 +0000 [thread overview]
Message-ID: <20151122165204.5e47bff9@ntlworld.com> (raw)
In-Reply-To: <20151122160955.0cc6da24@ntlworld.com>
Test for the hash command.
pws
diff --git a/Test/B09hash.ztst b/Test/B09hash.ztst
new file mode 100644
index 0000000..49f3048
--- /dev/null
+++ b/Test/B09hash.ztst
@@ -0,0 +1,71 @@
+# The hash builtin is most used for the command hash table, which is
+# populated automatically. This is therefore highly system specific,
+# so mostly we'll test with the directory hash table: the logic is
+# virtually identical but with the different table, and furthermore
+# the shell doesn't care whether the directory exists unless you refer
+# to it in a context that needs one.
+
+%prep
+ populate_hash() {
+ hash -d one=/first/directory
+ hash -d two=/directory/the/second
+ hash -d three=/noch/ein/verzeichnis
+ hash -d four=/bored/with/this/now
+ }
+
+%test
+
+ hash -d
+0:Directory hash initially empty
+
+ populate_hash
+ hash -d
+0:Populating directory hash and output with sort
+>four=/bored/with/this/now
+>one=/first/directory
+>three=/noch/ein/verzeichnis
+>two=/directory/the/second
+
+ hash -rd
+ hash -d
+0:Empty hash
+
+ populate_hash
+ hash -d
+0:Refill hash
+>four=/bored/with/this/now
+>one=/first/directory
+>three=/noch/ein/verzeichnis
+>two=/directory/the/second
+
+ hash -dL
+0:hash -L option
+>hash -d four=/bored/with/this/now
+>hash -d one=/first/directory
+>hash -d three=/noch/ein/verzeichnis
+>hash -d two=/directory/the/second
+
+ hash -dm 't*'
+0:hash -m option
+>three=/noch/ein/verzeichnis
+>two=/directory/the/second
+
+ hash -d five=/yet/more six=/here/we/go seven=/not/yet/eight
+ hash -d
+0:Multiple assignments
+>five=/yet/more
+>four=/bored/with/this/now
+>one=/first/directory
+>seven=/not/yet/eight
+>six=/here/we/go
+>three=/noch/ein/verzeichnis
+>two=/directory/the/second
+
+ hash -d one two three
+0:Multiple arguments with no assignment not in verbose mode
+
+ hash -vd one two three
+0:Multiple arguments with no assignment in verbose mode
+>one=/first/directory
+>two=/directory/the/second
+>three=/noch/ein/verzeichnis
prev parent reply other threads:[~2015-11-22 16:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-21 18:35 Peter Stephenson
2015-11-21 18:54 ` Pascal Wittmann
2015-11-21 19:09 ` Simon Ruderich
2015-11-21 22:25 ` Bart Schaefer
2015-11-22 14:31 ` Christian Heinrich
2015-11-22 15:31 ` Peter Stephenson
2015-11-24 7:41 ` Simon Ruderich
2015-11-21 23:01 ` Test/V01private.ztst skipped (was: zsh 5.1.1-test-1) Daniel Shahaf
2015-11-22 1:09 ` Bart Schaefer
2015-11-25 1:44 ` Daniel Shahaf
2015-11-22 1:14 ` Bart Schaefer
2015-11-22 7:51 ` Bart Schaefer
2015-11-22 10:54 ` zsh 5.1.1-test-1 Sebastian Gniazdowski
2015-11-22 11:48 ` Manuel Presnitz
2015-11-22 12:23 ` Mikael Magnusson
2015-11-22 16:09 ` Peter Stephenson
2015-11-22 16:52 ` Peter Stephenson [this message]
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=20151122165204.5e47bff9@ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=mpy@gmx.net \
--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).