1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2025-12-14 18:25:12 +02:00

Merge pull request #22 from Tarrasch/improve-and-test-zstat-integration

Improve and test zstat integration
This commit is contained in:
Daniel Hahler
2015-01-26 14:08:25 +01:00
5 changed files with 52 additions and 19 deletions

View File

@@ -0,0 +1,13 @@
# Use invalid module path for zsh, to test alternative zstat implementation.
# Pre-load zsh/parameter, where we do not have/need(?) an alternative
# implementation.
zmodload zsh/parameter
module_path=(/dev/null)
zstat() {
echo "Should not get called."
}
source ${ZDOTDIR}/../ZDOTDIR/.zshenv

View File

@@ -12,6 +12,8 @@ Add existing entries.
$ mkdir -p sub/sub2
$ touch -t 201401010101 sub/file
$ touch -t 201401010102 sub
$ touch -t 201401010103 sub/sub2
$ _autoenv_stack_entered_add sub
$ _autoenv_stack_entered_add sub/file
$ _autoenv_stack_entered_add sub/sub2
@@ -26,7 +28,7 @@ Add existing entries.
sub sub/file sub/sub2 non-existing
$ echo $_autoenv_stack_entered_mtime
0 1388538060 0 0 (glob)
1388538180 1388538060 1388538120 0
Touch the file and re-add it.

View File

@@ -71,3 +71,17 @@ Re-add the first one, with a new hash.
:/tmp/cramtests-*/_autoenv_utils.t/second:7bee8f3b184e1e141ff76efe369c3b8bfc50e64c:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/first:65eb010197b73ddc109b7210080f97a87f53451e:1 (glob)
}}}
Explicit calls to _autoenv_get_file_mtime to test alternative implementation
of _autoenv_get_file_mtime (via ZDOTDIR.invalid-module_path/).
$ _autoenv_get_file_mtime non-existing
0
$ touch -t 201401010101 file
$ _autoenv_get_file_mtime file
1388538060
$ mkdir dir
$ touch -t 201401010102 dir
$ _autoenv_get_file_mtime dir
1388538120