summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-01-30 10:31:11 +0000
committerPeter Stephenson <pws@zsh.org>2017-01-30 10:31:11 +0000
commited855baf482240e0f090b22e06b0f6b8b38c05ea (patch)
tree9cadb63ca745fc5f5672b08bfdb75b7e2cc13dea
parentb0073410eb9b4694260d63cb61f67056f487a546 (diff)
downloadzsh-ed855baf482240e0f090b22e06b0f6b8b38c05ea.tar.gz
zsh-ed855baf482240e0f090b22e06b0f6b8b38c05ea.tar.xz
zsh-ed855baf482240e0f090b22e06b0f6b8b38c05ea.zip
40465: update methods to output $PWD in tests.
Use method from B01cd.tst which resolves symbolic links and
matches against parameter in output.
-rw-r--r--ChangeLog5
-rw-r--r--Test/C04funcdef.ztst10
-rw-r--r--Test/V06parameter.ztst31
3 files changed, 31 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 90e76cbb6..0e59e805a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-30  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 40465: Test/C04funcdef.ztst, Test/V06parameter.ztst: use
+	method from cd tests to output current directory.
+
 2017-01-29  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	*  Zhiming Wang: 40450, 40451: Completion/Unix/Command/_swift,
diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index 176841dd2..0cf2b58b9 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -2,6 +2,10 @@
 
   mkdir funcdef.tmp
   cd funcdef.tmp
+  setopt chaselinks
+  cd .
+  unsetopt chaselinks
+  mydir=$PWD
 
 %test
 
@@ -325,10 +329,10 @@
     printf '%s\n' 'oops(){}' 'ninjas-earring(){}' 'oops "$@"' >oops
     autoload oops
     oops
-    whence -v oops | sed -e "s%$PWD%CURDIR%"
+    whence -v oops
   )
-0:whence -v of zsh-style autoload
->oops is a shell function from CURDIR/oops
+0q:whence -v of zsh-style autoload
+>oops is a shell function from $mydir/oops
 
   (
     fpath=(.)
diff --git a/Test/V06parameter.ztst b/Test/V06parameter.ztst
index c2a2a4da5..10e0a276e 100644
--- a/Test/V06parameter.ztst
+++ b/Test/V06parameter.ztst
@@ -1,15 +1,22 @@
+%prep
+
+  setopt chaselinks
+  cd .
+  unsetopt chaselinks
+  mydir=$PWD
+
 %test
 
   print 'print In sourced file
-  print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+  print $LINENO + $functrace + ${funcsourcetrace}
   ' >sourcedfile
   print -r -- 'print Started functrace.zsh
   module_path=(./Modules)
-  print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+  print $LINENO + $functrace + ${funcsourcetrace}
   :
   fn() {
     print Inside function $0
-    print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+    print $LINENO + $functrace + ${funcsourcetrace}
   }
   :
   fn
@@ -17,7 +24,7 @@
   fpath=(. $fpath)
   :
   echo '\''print Inside $0
-    print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+    print $LINENO + $functrace + ${funcsourcetrace}
   '\'' >autofn
   :
   autoload autofn
@@ -26,15 +33,15 @@
   autofn
   . ./sourcedfile' >functrace.zsh
   $ZTST_testdir/../Src/zsh +Z -f ./functrace.zsh
-0:Function tracing
+0q:Function tracing
 >Started functrace.zsh
 >3 + +
 >Inside function fn
 >2 + ./functrace.zsh:10 + ./functrace.zsh:5
 >Inside autofn
->2 + ./functrace.zsh:20 + CURDIR/autofn:0
+>2 + ./functrace.zsh:20 + $mydir/autofn:0
 >Inside autofn
->2 + ./functrace.zsh:21 + CURDIR/autofn:0
+>2 + ./functrace.zsh:21 + $mydir/autofn:0
 >In sourced file
 >2 + ./functrace.zsh:22 + ./sourcedfile:0
 
@@ -70,14 +77,14 @@
     fpath=($PWD)
     print "print I have been autoloaded" >myfunc
     autoload $PWD/myfunc
-    print ${functions_source[myfunc]/#$PWD/CURDIR}
+    print ${functions_source[myfunc]}
     myfunc
-    print ${functions_source[myfunc]/#$PWD/CURDIR}
+    print ${functions_source[myfunc]}
   )
-0: $functions_source
->CURDIR/myfunc
+0q: $functions_source
+>$mydir/myfunc
 >I have been autoloaded
->CURDIR/myfunc
+>$mydir/myfunc
 
 %clean