diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rwxr-xr-x | test/indent/shell.rc | 30 | ||||
| -rwxr-xr-x | test/indent/shell.sh | 98 |
3 files changed, 133 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index f555878cb49..3f2dbec1e55 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-02-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * indent/shell.sh: | ||
| 4 | * indent/shell.rc: New files. | ||
| 5 | |||
| 1 | 2011-01-27 Chong Yidong <cyd@stupidchicken.com> | 6 | 2011-01-27 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * automated/font-parse-tests.el: Move from | 8 | * automated/font-parse-tests.el: Move from |
diff --git a/test/indent/shell.rc b/test/indent/shell.rc new file mode 100755 index 00000000000..841223555b9 --- /dev/null +++ b/test/indent/shell.rc | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #!/bin/rc | ||
| 2 | |||
| 3 | if (foo) { | ||
| 4 | echo 1 | ||
| 5 | } | ||
| 6 | if not { | ||
| 7 | echo 2 | ||
| 8 | } | ||
| 9 | |||
| 10 | if (foo) | ||
| 11 | echo 3 # KNOWN INDENT BUG | ||
| 12 | if not | ||
| 13 | echo 4 # KNOWN INDENT BUG | ||
| 14 | |||
| 15 | switch ($a) { | ||
| 16 | case 3 | ||
| 17 | echo 4 | ||
| 18 | case 5 | ||
| 19 | echo 7 | ||
| 20 | for (i in a b c) { | ||
| 21 | echo $i | ||
| 22 | } | ||
| 23 | for (i in a b c) | ||
| 24 | echo "$i" # KNOWN INDENT BUG | ||
| 25 | echo titi | ||
| 26 | |||
| 27 | case * | ||
| 28 | echo other | ||
| 29 | } | ||
| 30 | |||
diff --git a/test/indent/shell.sh b/test/indent/shell.sh new file mode 100755 index 00000000000..89f47d0bfe3 --- /dev/null +++ b/test/indent/shell.sh | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | setlock -n /tmp/getmail.lock && echo getmail isn\'t running | ||
| 4 | |||
| 5 | # adsgsdg | ||
| 6 | |||
| 7 | foo () { | ||
| 8 | |||
| 9 | bar () { | ||
| 10 | blilbi | ||
| 11 | } | ||
| 12 | |||
| 13 | case toto | ||
| 14 | in a) hello # KNOWN INDENT BUG | ||
| 15 | ;; b) hi # KNOWN INDENT BUG | ||
| 16 | esac | ||
| 17 | |||
| 18 | case $toto in | ||
| 19 | a) echo 1;; b) echo 2;; | ||
| 20 | c) echo 3;; | ||
| 21 | esac | ||
| 22 | |||
| 23 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | ||
| 24 | *${as_nl}ac_space=\ *) | ||
| 25 | # `set' does not quote correctly, so add quotes: double-quote | ||
| 26 | # substitution turns \\\\ into \\, and sed turns \\ into \. | ||
| 27 | sed -n \ | ||
| 28 | "s/'/'\\\\''/g; | ||
| 29 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p" | ||
| 30 | ;; #( | ||
| 31 | *) | ||
| 32 | # `set' quotes correctly as required by POSIX, so do not add | ||
| 33 | # quotes. | ||
| 34 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | ||
| 35 | ;; | ||
| 36 | esac | | ||
| 37 | cat # KNOWN INDENT BUG | ||
| 38 | |||
| 39 | case toto in | ||
| 40 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | ||
| 41 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \ | ||
| 42 | | --exec=* | --exe=* | --ex=*) | ||
| 43 | exec_prefix=$ac_optarg ;; | ||
| 44 | 5) | ||
| 45 | hello ;; | ||
| 46 | 3) hello $(adfad) | ||
| 47 | echo esac ;; # KNOWN INDENT BUG | ||
| 48 | 5) hello ;; | ||
| 49 | 4) hello ;& | ||
| 50 | 4) hello ;;& | ||
| 51 | 5) hello ;; | ||
| 52 | 5) hello ;; | ||
| 53 | esac | ||
| 54 | |||
| 55 | echo "'" wfgfe | ||
| 56 | |||
| 57 | #!/bin/bash | ||
| 58 | cat << EOF \ | ||
| 59 | | cat sadfsafd \ | ||
| 60 | sadfsafd "KNOWN INDENT BUG" \ | ||
| 61 | | tee -a bug.txt | ||
| 62 | asdfsaf | ||
| 63 | This is a test case for a bug in bash shell mode text highlighting | ||
| 64 | EOF | ||
| 65 | |||
| 66 | cat <<EOF1 <<EOF2 # KNOWN INDENT BUG | ||
| 67 | help1 | ||
| 68 | EOF1 | ||
| 69 | help2 | ||
| 70 | EOF2 | ||
| 71 | } | ||
| 72 | bar () { | ||
| 73 | if [ $# == 0 ]; then | ||
| 74 | while | ||
| 75 | f # KNOWN INDENT BUG | ||
| 76 | do | ||
| 77 | bla; | ||
| 78 | done | ||
| 79 | echo "Highlighting is screwed up now" | ||
| 80 | if [ 1 = 1 ]; then | ||
| 81 | # adsgsdg | ||
| 82 | echo "screwed up" | ||
| 83 | fi | ||
| 84 | |||
| 85 | $@ $? $# | ||
| 86 | |||
| 87 | for f in * | ||
| 88 | do | ||
| 89 | sdfg | ||
| 90 | done | ||
| 91 | |||
| 92 | if swrgfef | ||
| 93 | then blas | ||
| 94 | else sdf | ||
| 95 | fi | ||
| 96 | |||
| 97 | fi | ||
| 98 | } | ||