summaryrefslogtreecommitdiffstats
path: root/Test/B12limit.ztst
blob: bc73d660a94b55dc519627a231218a1b86c97f16 (plain) (blame)
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
%prep

  ZSH_TEST_LANG=$(ZTST_find_UTF8)
  if ! zmodload zsh/rlimits 2>/dev/null
  then
    ZTST_unimplemented="the zsh/rlimits module was disabled by configure (see config.modules)"
    return 0
  fi
  zmodload zsh/rlimits

%test

 limit | grep UNKNOWN || print OK
0:Check if there is unknown resource(s) in the system
>OK
F:A failure here does not indicate any error in zsh. It just means there
F:is a resource in your system that is unknown to zsh developers. Please
F:report this to zsh-workers mailing list.

  () {
    set -- ${(f)"$(ulimit -a)"}
    set -- ${@%%:*}
    typeset -aU unique_options=( "$@" )
    # The value of $unique_options is, e.g., ( -t -f '-N 2' -s ... ).
    (( $# == $#unique_options ))
  }
0:check if limit option letters are unique

  ulimit -z
1:bad option letter
?(eval):ulimit:1: bad option: -z

  ulimit -N
1:missing number after -N
?(eval):ulimit:1: number required after -N

  ulimit -N abc
1:invalid number after -N
?(eval):ulimit:1: invalid number: abc

  ulimit -at
1:resource option combined with -a
?(eval):ulimit:1: no limits allowed with -a

  if [[ -z $ZSH_TEST_LANG ]]; then
    ZTST_skip='no UTF-8 locale'
  else
    LANG=$ZSH_TEST_LANG
    ulimit -の
  fi
1:bad multibyte option letter
?(eval):ulimit:5: bad option: -の