zsh-workers
 help / color / mirror / code / Atom feed
* More C02cond tweaking
@ 2001-05-30 10:37 Andrej Borsenkow
  2001-05-30 15:12 ` Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Andrej Borsenkow @ 2001-05-30 10:37 UTC (permalink / raw)
  To: ZSH Workers Mailing List

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

This adds more tests for unsuported features.

-x test in current form fails (under some conditions); the change works
almost - currently it fails if test directory is on SAMBA (or, probably, any
network) drive.

-N does not work on Cygwin. I mailed cygwin list as it looks like a bug
(AFAIK both FAT/NTFS support notion of different access and modification
times).

/dev/fd is not supported on Cygwin so -e and -O obviously failed. Manual
says, that it is emulated - but I am not sure, in which context it can be
used.

-andrej

[-- Attachment #2: zsh-c02cond.diff --]
[-- Type: application/octet-stream, Size: 1869 bytes --]

Index: Test/C02cond.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v
retrieving revision 1.6
diff -u -r1.6 C02cond.ztst
--- Test/C02cond.ztst	2001/05/28 16:33:54	1.6
+++ Test/C02cond.ztst	2001/05/30 10:27:28
@@ -21,6 +21,9 @@
 
   touch unmodish
   chmod 000 unmodish
+
+  print 'MZ' > cmd.exe
+  chmod +x cmd.exe
 %test
 
   [[ -a zerolength && ! -a nonexistent ]]
@@ -92,7 +95,7 @@
   [[ -u modish && ! -u zerolength ]]
 0:-u cond
 
-  [[ -x $ZTST_srcdir/ztst.zsh && ! -x zerolength ]]
+  [[ -x cmd.exe && ! -x zerolength ]]
 0:-x cond
 
   [[ -z $bar && -z '' && ! -z $foo ]]
@@ -113,7 +116,12 @@
   sleep 1
   cat unmodified
   touch newnewnew
-  [[ -N newnewnew && ! -N unmodified ]]
+  if [[ $OSTYPE == "cygwin" ]]; then
+    print -u8 "Warning: not testing [[ -N file ]] (not supported on Cygwin)"
+    true
+  else
+    [[ -N newnewnew && ! -N unmodified ]]
+  fi
 0:-N cond
 
   [[ newnewnew -nt zerolength && ! (unmodified -nt zerolength) ]]
@@ -146,11 +154,21 @@
   [[ 1 -lt 2 || 2 -lt 2 && 3 -gt 4 ]]
 0:|| and && in conds
 
-  [[ -e /dev/fd/0 ]]
-0:/dev/fd support in conds handled by access
+  if ! grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h; then
+    print -u8 "Warning: not testing [[ -e /dev/fd/0 ]] (/dev/fd not supported)"
+    true
+  else
+    [[ -e /dev/fd/0 ]]
+  fi
+0dD:/dev/fd support in conds handled by access
 
-  [[ -O /dev/fd/0 ]]
-0:/dev/fd support in conds handled by stat
+  if ! grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h; then
+    print -u8 "Warning: not testing [[ -O /dev/fd/0 ]] (/dev/fd not supported)"
+    true
+  else
+    [[ -O /dev/fd/0 ]]
+  fi
+0dD:/dev/fd support in conds handled by stat
 
   [[ ( -z foo && -z foo ) || -z foo ]]
 1:complex conds with skipping

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: More C02cond tweaking
  2001-05-30 10:37 More C02cond tweaking Andrej Borsenkow
@ 2001-05-30 15:12 ` Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2001-05-30 15:12 UTC (permalink / raw)
  To: ZSH Workers Mailing List


>
> -N does not work on Cygwin. I mailed cygwin list as it looks like a bug
> (AFAIK both FAT/NTFS support notion of different access and modification
> times).

Anybody has an idea if we can provide a workaround for this Windows
"feature"?

Note  Not all file systems can record creation and last access time and not
all file systems record them in the same manner. For example, on Windows NT
FAT, create time has a resolution of 10 milliseconds, write time has a
resolution of 2 seconds, and access time has a resolution of 1 day (really,
the access date). On NTFS, access time has a resolution of 1 hour.
Furthermore, FAT records times on disk in local time, while NTFS records
times on disk in UTC, so it is not affected by changes in time zone or
daylight saving time.


(<http://msdn.microsoft.com/library/psdk/sysmgmt/time_8hwz.htm>)

-andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-30 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-30 10:37 More C02cond tweaking Andrej Borsenkow
2001-05-30 15:12 ` Andrej Borsenkow

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).