Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_inputrc.aug
1 (*
2 Module: Test_Inputrc
3   Provides unit tests and examples for the <Inputrc> lens.
4 *)
5
6 module Test_Inputrc =
7
8 (* Variable: conf *)
9 let conf = "# /etc/inputrc - global inputrc for libreadline
10 # See readline(3readline) and `info rluserman' for more information.
11
12 # Be 8 bit clean.
13 set input-meta on
14 set output-meta on
15
16 # To allow the use of 8bit-characters like the german umlauts, uncomment
17 # the line below. However this makes the meta key not work as a meta key,
18 # which is annoying to those which don't need to type in 8-bit characters.
19
20 # set convert-meta off
21
22 # try to enable the application keypad when it is called.  Some systems
23 # need this to enable the arrow keys.
24 # set enable-keypad on
25
26 # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
27
28 # do not bell on tab-completion
29 # set bell-style none
30 # set bell-style visible
31
32 # some defaults / modifications for the emacs mode
33 $if mode=emacs
34
35 # allow the use of the Home/End keys
36 \"\\e[1~\": beginning-of-line
37 \"\\e[4~\": end-of-line
38
39 # allow the use of the Delete/Insert keys
40 \"\\e[3~\": delete-char
41 \"\\e[2~\": quoted-insert
42
43 # mappings for \"page up\" and \"page down\" to step to the beginning/end
44 # of the history
45 # \"\\e[5~\": beginning-of-history
46 # \"\\e[6~\": end-of-history
47
48 # alternate mappings for \"page up\" and \"page down\" to search the history
49 # \"\\e[5~\": history-search-backward
50 # \"\\e[6~\": history-search-forward
51
52 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
53 \"\\e[1;5C\": forward-word
54 \"\\e[1;5D\": backward-word
55 \"\\e[5C\": forward-word
56 \"\\e[5D\": backward-word
57 \"\\e\\e[C\": forward-word
58 \"\\e\\e[D\": backward-word
59
60 $if term=rxvt
61 \"\\e[8~\": end-of-line
62 \"\\eOc\": forward-word
63 \"\\eOd\": backward-word
64 $else
65 \"\\e[G\": \",\"
66 $endif
67
68 # for non RH/Debian xterm, can't hurt for RH/Debian xterm
69 # \"\\eOH\": beginning-of-line
70 # \"\\eOF\": end-of-line
71
72 # for freebsd console
73 # \"\\e[H\": beginning-of-line
74 # \"\\e[F\": end-of-line
75
76 $endif
77 "
78
79 (* Test: Inputrc.lns *)
80 test Inputrc.lns get conf =
81   { "#comment" = "/etc/inputrc - global inputrc for libreadline" }
82   { "#comment" = "See readline(3readline) and `info rluserman' for more information." }
83   {  }
84   { "#comment" = "Be 8 bit clean." }
85   { "input-meta" = "on" }
86   { "output-meta" = "on" }
87   {  }
88   { "#comment" = "To allow the use of 8bit-characters like the german umlauts, uncomment" }
89   { "#comment" = "the line below. However this makes the meta key not work as a meta key," }
90   { "#comment" = "which is annoying to those which don't need to type in 8-bit characters." }
91   {  }
92   { "#comment" = "set convert-meta off" }
93   {  }
94   { "#comment" = "try to enable the application keypad when it is called.  Some systems" }
95   { "#comment" = "need this to enable the arrow keys." }
96   { "#comment" = "set enable-keypad on" }
97   {  }
98   { "#comment" = "see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys" }
99   {  }
100   { "#comment" = "do not bell on tab-completion" }
101   { "#comment" = "set bell-style none" }
102   { "#comment" = "set bell-style visible" }
103   {  }
104   { "#comment" = "some defaults / modifications for the emacs mode" }
105   { "@if" = "mode=emacs"
106     {  }
107     { "#comment" = "allow the use of the Home/End keys" }
108     { "entry" = "\\e[1~"
109       { "mapping" = "beginning-of-line" }
110     }
111     { "entry" = "\\e[4~"
112       { "mapping" = "end-of-line" }
113     }
114     {  }
115     { "#comment" = "allow the use of the Delete/Insert keys" }
116     { "entry" = "\\e[3~"
117       { "mapping" = "delete-char" }
118     }
119     { "entry" = "\\e[2~"
120       { "mapping" = "quoted-insert" }
121     }
122     {  }
123     { "#comment" = "mappings for \"page up\" and \"page down\" to step to the beginning/end" }
124     { "#comment" = "of the history" }
125     { "#comment" = "\"\\e[5~\": beginning-of-history" }
126     { "#comment" = "\"\\e[6~\": end-of-history" }
127     {  }
128     { "#comment" = "alternate mappings for \"page up\" and \"page down\" to search the history" }
129     { "#comment" = "\"\\e[5~\": history-search-backward" }
130     { "#comment" = "\"\\e[6~\": history-search-forward" }
131     {  }
132     { "#comment" = "mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving" }
133     { "entry" = "\\e[1;5C"
134       { "mapping" = "forward-word" }
135     }
136     { "entry" = "\\e[1;5D"
137       { "mapping" = "backward-word" }
138     }
139     { "entry" = "\\e[5C"
140       { "mapping" = "forward-word" }
141     }
142     { "entry" = "\\e[5D"
143       { "mapping" = "backward-word" }
144     }
145     { "entry" = "\\e\\e[C"
146       { "mapping" = "forward-word" }
147     }
148     { "entry" = "\\e\\e[D"
149       { "mapping" = "backward-word" }
150     }
151     {  }
152     { "@if" = "term=rxvt"
153       { "entry" = "\\e[8~"
154         { "mapping" = "end-of-line" }
155       }
156       { "entry" = "\\eOc"
157         { "mapping" = "forward-word" }
158       }
159       { "entry" = "\\eOd"
160         { "mapping" = "backward-word" }
161       }
162       { "@else"
163         { "entry" = "\\e[G"
164           { "mapping" = "\",\"" }
165         }
166       }
167     }
168     {  }
169     { "#comment" = "for non RH/Debian xterm, can't hurt for RH/Debian xterm" }
170     { "#comment" = "\"\\eOH\": beginning-of-line" }
171     { "#comment" = "\"\\eOF\": end-of-line" }
172     {  }
173     { "#comment" = "for freebsd console" }
174     { "#comment" = "\"\\e[H\": beginning-of-line" }
175     { "#comment" = "\"\\e[F\": end-of-line" }
176     {  }
177   }
178