Fix readline prompt to correctly handle UTF-8 characters
[tig.git] / test / tigrc / tigrc-manpage-examples-test
blob95667747b9e2a93aa38d708292679af85471fa57
1 #!/bin/sh
3 . libtest.sh
5 steps ":quit"
7 mkdir snippets
9 out_file=
11 while read line; do
12 case "$line" in
13 "// TEST: tigrc")
14 out_file="$(mktemp snippets/tigrc.XXXXXX)"
16 "// TEST: gitconfig")
17 out_file="$(mktemp snippets/gitconfig.XXXXXX)"
19 "--------------"*)
20 if [ -s "$out_file" ]; then
21 out_file=
22 elif [ -e "$out_file" ]; then
23 echo >> "$out_file"
27 if [ -e "$out_file" ]; then
28 echo "$line" >> "$out_file"
31 esac
32 done < "$base_dir/../doc/tigrc.5.adoc"
34 # Create files used by the `source` example
35 mkdir .tig
36 touch .tig/colorscheme.tigrc .tig/keybindings.tigrc
38 tigrc <<EOF
39 $(find snippets -name "tigrc.*" | xargs cat)
40 EOF
42 gitconfig <<EOF
43 $(find snippets -name "gitconfig.*" | xargs cat)
44 EOF
46 test_tig
48 assert_equals stderr <<EOF
49 EOF