Move relative date formatting to separate function
[tig.git] / test / tigrc / quote-test
blob7794a99268196ce9604085d488fcde499c3c349f
1 #!/bin/sh
3 . libtest.sh
4 . libgit.sh
6 LINES=3
8 tigrc <<EOF
9 bind generic 1 !@sh -c "echo \"double \$@\" 'quoted' \"shell command\" > $HOME/shell-command.txt"
10 bind generic 2 !@sh -c 'echo \'single \'\$@ "quoted" \'shell command\' >> $HOME/shell-command.txt'
12 bind generic 3 :!echo git log "%(prompt Prompt: )"
13 bind generic 4 :!echo git log -G"%(prompt Prompt: )"
14 bind generic 5 :!echo git log -G' \' "\" \\\a\b'
15 bind generic 6 :!echo git log -G"'\' \" \\\a\b"
16 EOF
18 steps "
23 |Quoted 'prompt' input|<Enter>
24 :save-display quoted-prompt-with-spaces.screen
26 |\"Mid-quoted\" prompt input|<Enter>
27 :save-display mid-quoted-prompt-with-spaces.screen
29 :save-display single-quoted-arg-with-escaped-chars.screen
31 :save-display double-quoted-arg-with-escaped-chars.screen
34 in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz"
35 test_tig
37 assert_equals stderr <<EOF
38 EOF
40 assert_equals 'shell-command.txt' <<EOF
41 double quoted shell command
42 single quoted shell command
43 EOF
45 assert_equals 'quoted-prompt-with-spaces.screen' <<EOF
46 git log |Quoted 'prompt' input|
47 [pager] echo git log |Quoted 'prompt' input| - line 1 of 1 100%
48 EOF
50 assert_equals 'mid-quoted-prompt-with-spaces.screen' <<EOF
51 git log -G|"Mid-quoted" prompt input|
52 [pager] echo git log -G|"Mid-quoted" prompt input| - line 1 of 1 100%
53 EOF
55 assert_equals 'single-quoted-arg-with-escaped-chars.screen' <<EOF
56 git log -G ' "" \\ab
57 [pager] echo git log -G ' "" \\ab - line 1 of 1 100%
58 EOF
60 assert_equals 'double-quoted-arg-with-escaped-chars.screen' <<EOF
61 git log -G'' " \\ab
62 [pager] echo git log -G'' " \\ab - line 1 of 1 100%
63 EOF