zsh-workers
 help / color / mirror / code / Atom feed
9fb1f3ebf838f08b3aff1fe74d9ef4a573348811 blob 1473 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
#
# This file contains tests for the "time" reserved word
#

%prep

  unset TIMEFMT

%test

  (time cat) >&/dev/null
0:`time' keyword (status only)

  ( TIMEFMT='%E %mE %uE %* %m%mm %u%uu'; time (:) )
0:`time' keyword with custom TIMEFMT
*?[0-9]##.[0-9](#c2)s [0-9]##ms [0-9]##us %\* %m%mm %u%uu

  time x=1
0:`time' simple assignment
*?shell*
*?children*

  time x=$(date)
0:`time' assignment with external command
*?shell*
*?children*

  x=0; time for ((i=1; i<=10000; ++i)); do ((x+=i)); done; echo $x
0:`time' for-loop with arithmetic condition
>50005000
*?shell*
*?children*

  time echo $(x=0;for ((i=0; i<=100000; ++i)); do ((x+=i)); done; echo $x)
0:`time' of a builtin with argument command substitution
>5000050000
*?shell*
*?children*

  time cat <(x=0;for ((i=0; i<=100000; ++i)); do ((x+=i)); done; echo $x)
0:`time' of external command with process substitution
>5000050000
*?*user*system*cpu*total

  print -u $ZTST_fd 'This test takes 2 seconds'
  time builtin nonesuch $(sleep 2)
1:`time' of nonexistent builtin with command substitution
*?*: no such builtin: nonesuch
*?shell*
*?children*

  time /no/such/commmand
127:`time' of nonexistent external
*?*no such file or directory: /no/such/commmand
*?*user*system*cpu*total

  ( setopt errexit; time false; print notreached )
1:`time' of failed builtin with errexit
*?shell*
*?children*

  ( setopt errexit; time =false; print notreached )
1:`time' of failed external with errexit
*?*user*system*cpu*total
debug log:

solving 9fb1f3ebf ...
found 9fb1f3ebf in https://git.vuxu.org/mirror/zsh/

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