* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
[bpt/emacs.git] / test / indent / shell.sh
index 89f47d0..74985a4 100755 (executable)
@@ -1,9 +1,50 @@
 #!/bin/sh
+# -*- eval: (bug-reference-mode 1) -*-
 
 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
 
 # adsgsdg
 
+if foo; then
+    if bar; then
+       toto
+    fi
+fi                              # bug#15613
+
+case $X in
+    foo)
+        do_something
+        ;;
+    arg=*)                     # bug#12953
+        do_something_else_based_on_arg
+        ;;
+    *)
+        default
+        ;;
+esac
+
+{                              # bug#17621
+    foo1 &&
+        foo2 &&
+        bar
+}
+
+echo -n $(( 5 << 2 ))
+# This should not be treated as a heredoc (bug#12770).
+2
+
+foo='bar<<'                     # bug#11263
+echo ${foo%<<aa}                # bug#11263
+echo $((1<<8))                  # bug#11263
+echo $[1<<8]                    # bug#11263
+
+declare -a VERSION
+for i in $(ls "$PREFIX/sbin") ; do
+    echo -e $N')' $i
+    VERSION[${#VERSION[*]}]=$i  # bug#11946.
+    N=$(($N + 1))
+done
+
 foo () {
 
     bar () {
@@ -13,11 +54,15 @@ foo () {
     case toto
     in a) hello                 # KNOWN INDENT BUG
     ;; b) hi                    # KNOWN INDENT BUG
+    ;; c) hi                    # KNOWN INDENT BUG
     esac
 
     case $toto in
         a) echo 1;; b) echo 2;;
-        c) echo 3;;
+        (c)
+            echo 3;;
+        d)
+            echo 3;;
     esac
     
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
@@ -34,7 +79,8 @@ foo () {
             sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
             ;;
     esac |
-        cat                     # KNOWN INDENT BUG
+        grep '.' |              # KNOWN INDENT BUG
+        sed 1d
     
     case toto in
         -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \