]> code.delx.au - gnu-emacs/blob - test/indent/shell.sh
Merge from emacs-24; up to 2012-12-17T11:17:34Z!rgm@gnu.org
[gnu-emacs] / test / indent / shell.sh
1 #!/bin/sh
2 # -*- eval: (bug-reference-mode 1) -*-
3
4 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
5
6 # adsgsdg
7
8 case $X in
9 foo)
10 do_something
11 ;;
12 arg=*) # bug#12953
13 do_something_else_based_on_arg
14 ;;
15 *)
16 default
17 ;;
18 esac
19
20 echo -n $(( 5 << 2 ))
21 # This should not be treated as a heredoc (bug#12770).
22 2
23
24 foo='bar<<' # bug#11263
25 echo ${foo%<<aa} # bug#11263
26 echo $((1<<8)) # bug#11263
27 echo $[1<<8] # bug#11263
28
29 declare -a VERSION
30 for i in $(ls "$PREFIX/sbin") ; do
31 echo -e $N')' $i
32 VERSION[${#VERSION[*]}]=$i #bug#11946.
33 N=$(($N + 1))
34 done
35
36 foo () {
37
38 bar () {
39 blilbi
40 }
41
42 case toto
43 in a) hello # KNOWN INDENT BUG
44 ;; b) hi # KNOWN INDENT BUG
45 ;; c) hi # KNOWN INDENT BUG
46 esac
47
48 case $toto in
49 a) echo 1;; b) echo 2;;
50 (c)
51 echo 3;;
52 d)
53 echo 3;;
54 esac
55
56 case $as_nl`(ac_space=' '; set) 2>&1` in #(
57 *${as_nl}ac_space=\ *)
58 # `set' does not quote correctly, so add quotes: double-quote
59 # substitution turns \\\\ into \\, and sed turns \\ into \.
60 sed -n \
61 "s/'/'\\\\''/g;
62 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
63 ;; #(
64 *)
65 # `set' quotes correctly as required by POSIX, so do not add
66 # quotes.
67 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
68 ;;
69 esac |
70 grep '.' | # KNOWN INDENT BUG
71 sed 1d
72
73 case toto in
74 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
75 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
76 | --exec=* | --exe=* | --ex=*)
77 exec_prefix=$ac_optarg ;;
78 5)
79 hello ;;
80 3) hello $(adfad)
81 echo esac ;; # KNOWN INDENT BUG
82 5) hello ;;
83 4) hello ;&
84 4) hello ;;&
85 5) hello ;;
86 5) hello ;;
87 esac
88
89 echo "'" wfgfe
90
91 #!/bin/bash
92 cat << EOF \
93 | cat sadfsafd \
94 sadfsafd "KNOWN INDENT BUG" \
95 | tee -a bug.txt
96 asdfsaf
97 This is a test case for a bug in bash shell mode text highlighting
98 EOF
99
100 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
101 help1
102 EOF1
103 help2
104 EOF2
105 }
106 bar () {
107 if [ $# == 0 ]; then
108 while
109 f # KNOWN INDENT BUG
110 do
111 bla;
112 done
113 echo "Highlighting is screwed up now"
114 if [ 1 = 1 ]; then
115 # adsgsdg
116 echo "screwed up"
117 fi
118
119 $@ $? $#
120
121 for f in *
122 do
123 sdfg
124 done
125
126 if swrgfef
127 then blas
128 else sdf
129 fi
130
131 fi
132 }