Add some shell indentation test cases.
[bpt/emacs.git] / test / indent / shell.sh
CommitLineData
ccded26c
SM
1#!/bin/sh
2
3setlock -n /tmp/getmail.lock && echo getmail isn\'t running
4
5# adsgsdg
6
7foo () {
8
9 bar () {
10 blilbi
11 }
12
13 case toto
14 in a) hello # KNOWN INDENT BUG
15 ;; b) hi # KNOWN INDENT BUG
461ef3c5 16 ;; c) hi # KNOWN INDENT BUG
ccded26c
SM
17 esac
18
19 case $toto in
20 a) echo 1;; b) echo 2;;
21 c) echo 3;;
22 esac
23
24 case $as_nl`(ac_space=' '; set) 2>&1` in #(
25 *${as_nl}ac_space=\ *)
26 # `set' does not quote correctly, so add quotes: double-quote
27 # substitution turns \\\\ into \\, and sed turns \\ into \.
28 sed -n \
29 "s/'/'\\\\''/g;
30 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
31 ;; #(
32 *)
33 # `set' quotes correctly as required by POSIX, so do not add
34 # quotes.
35 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
36 ;;
37 esac |
461ef3c5
SM
38 grep '.' | # KNOWN INDENT BUG
39 sed 1d
ccded26c
SM
40
41 case toto in
42 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
43 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
44 | --exec=* | --exe=* | --ex=*)
45 exec_prefix=$ac_optarg ;;
46 5)
47 hello ;;
48 3) hello $(adfad)
49 echo esac ;; # KNOWN INDENT BUG
50 5) hello ;;
51 4) hello ;&
52 4) hello ;;&
53 5) hello ;;
54 5) hello ;;
55 esac
56
57 echo "'" wfgfe
58
59 #!/bin/bash
60 cat << EOF \
61 | cat sadfsafd \
62 sadfsafd "KNOWN INDENT BUG" \
63 | tee -a bug.txt
64asdfsaf
65This is a test case for a bug in bash shell mode text highlighting
66EOF
67
68 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
69help1
70EOF1
71help2
72EOF2
73}
74bar () {
75 if [ $# == 0 ]; then
76 while
77 f # KNOWN INDENT BUG
78 do
79 bla;
80 done
81 echo "Highlighting is screwed up now"
82 if [ 1 = 1 ]; then
83 # adsgsdg
84 echo "screwed up"
85 fi
86
87 $@ $? $#
88
89 for f in *
90 do
91 sdfg
92 done
93
94 if swrgfef
95 then blas
96 else sdf
97 fi
98
99 fi
100}