3 Provides unit tests and examples for the <Aliases> lens.
9 A full configuration file *)
11 # Aliases in this file will NOT be expanded in the header from
12 # Mail, but WILL be visible over networks or from /bin/mail.
14 # Basic system aliases -- these MUST be present.
15 mailer-daemon: postmaster
18 # General redirections for pseudo accounts.
25 pipe2 : |\"/usr/bin/ls args,\"
29 Testing <Aliases.lns> on <file> *)
30 test Aliases.lns get file =
32 { "#comment" = "Aliases in this file will NOT be expanded in the header from" }
33 { "#comment" = "Mail, but WILL be visible over networks or from /bin/mail." }
35 { "#comment" = "Basic system aliases -- these MUST be present." }
36 { "1" { "name" = "mailer-daemon" }
37 { "value" = "postmaster" } }
38 { "2" { "name" = "postmaster" }
39 { "value" = "root" } }
41 { "#comment" = "General redirections for pseudo accounts." }
42 { "3" { "name" = "bin" }
46 { "4" { "name" = "daemon" }
47 { "value" = "root" } }
48 { "5" { "name" = "adm" }
49 { "value" = "root" } }
50 { "6" { "name" = "file" }
51 { "value" = "/var/foo" } }
52 { "7" { "name" = "pipe1" }
53 { "value" = "|/bin/ls" } }
54 { "8" { "name" = "pipe2" }
55 { "value" = "|\"/usr/bin/ls args,\"" } }
58 Put test for <Aliases.lns> on <file> *)
59 test Aliases.lns put file after
60 rm "/4" ; rm "/5" ; rm "/6" ; rm "/7" ; rm "/8" ;
61 set "/1/value[2]" "barbar" ;
62 set "/3/value[2]" "ruth"
64 # Aliases in this file will NOT be expanded in the header from
65 # Mail, but WILL be visible over networks or from /bin/mail.
67 # Basic system aliases -- these MUST be present.
68 mailer-daemon: postmaster, barbar
71 # General redirections for pseudo accounts.
77 Schema violation, no 3/name *)
78 test Aliases.lns put file after
80 set "/3/value/2" "ruth"
84 Don't have to have whitespace after a comma *)
85 let nocomma = "alias: target1,target2\n"
88 Testing <Aliases.lns> on <nocomma> *)
89 test Aliases.lns get nocomma =
92 { "value" = "target1" }
93 { "value" = "target2" } }
96 Ticket #229: commands can be fully enclosed in quotes *)
97 test Aliases.lns get "somebody: \"|exit 67\"\n" =
99 { "name" = "somebody" }
100 { "value" = "\"|exit 67\"" } }
103 Don't have to have whitespace after the colon *)
104 test Aliases.lns get "alias:target\n" =
107 { "value" = "target" } }
109 (* Local Variables: *)