~ubuntu-branches/ubuntu/saucy/augeas/saucy-proposed

« back to all changes in this revision

Viewing changes to lenses/tests/test_aliases.aug

  • Committer: Package Import Robot
  • Author(s): Free Ekanayaka
  • Date: 2012-05-20 09:45:39 UTC
  • mfrom: (1.5.1) (19.1.14 precise)
  • Revision ID: package-import@ubuntu.com-20120520094539-3zomeumx6zgt37ft
Tags: 0.10.0-1
* New upstream release
* Pull packaging changes from Ubuntu (see the changelog)
* Pull packaging changes from Igor Pashev's package at mentors.d.o:
  - Update maintainer's email
  - Add upstream sudoers.patch (Closes: #650079)
  - Add upstream debctl.patch (Closes: #650887)
  - Add upstream modprobe.patch (Closes: #641813)
  - Add cpp-linkage.patch for C++ linkage
  - Add gnulib-build-out-of-source.patch for building out of source tree
  - Add regexp-escape.patch for escape() usage on systems without uselocale()
  * Fix build-deps on naturaldocs (build-depends-on-1-revision)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
Module: Test_Aliases
 
3
  Provides unit tests and examples for the <Aliases> lens.
 
4
*)
 
5
 
1
6
module Test_aliases =
2
7
 
 
8
(* Variable: file
 
9
   A full configuration file *)
3
10
  let file = "#
4
11
#  Aliases in this file will NOT be expanded in the header from
5
12
#  Mail, but WILL be visible over networks or from /bin/mail.
15
22
adm:            root
16
23
file:           /var/foo
17
24
pipe1:          |/bin/ls
18
 
pipe2:          |\"/usr/bin/ls args,\"
 
25
pipe2 :         |\"/usr/bin/ls args,\"
19
26
"
 
27
 
 
28
(* Test: Aliases.lns
 
29
   Testing <Aliases.lns> on <file> *)
20
30
  test Aliases.lns get file =
21
31
    { }
22
32
    { "#comment" = "Aliases in this file will NOT be expanded in the header from" }
44
54
    { "8" { "name" = "pipe2" }
45
55
          { "value" = "|\"/usr/bin/ls args,\"" } }
46
56
 
 
57
(* Test: Aliases.lns
 
58
   Put test for <Aliases.lns> on <file> *)
47
59
  test Aliases.lns put file after
48
60
    rm "/4" ; rm "/5" ; rm "/6" ; rm "/7" ; rm "/8" ;
49
61
      set "/1/value[2]" "barbar" ;
61
73
  bob
62
74
"
63
75
 
64
 
  (* Schema violation, no 3/name *)
 
76
  (* Test: Aliases.lns
 
77
     Schema violation, no 3/name *)
65
78
  test Aliases.lns put file after
66
79
      rm "/3" ;
67
80
      set "/3/value/2" "ruth"
68
81
    = *
69
82
 
70
 
  (* Don't have to have whitespace after a comma *)
 
83
  (* Variable: nocomma
 
84
     Don't have to have whitespace after a comma *)
71
85
  let nocomma = "alias: target1,target2\n"
72
86
 
 
87
  (* Test: Aliases.lns
 
88
     Testing <Aliases.lns> on <nocomma> *)
73
89
  test Aliases.lns get nocomma =
74
90
    { "1"
75
91
        { "name" = "alias" }
76
92
        { "value" = "target1" }
77
93
        { "value" = "target2" } }
78
94
 
 
95
  (* Test: Aliases.lns
 
96
     Ticket #229: commands can be fully enclosed in quotes *)
 
97
  test Aliases.lns get "somebody: \"|exit 67\"\n" =
 
98
    { "1"
 
99
        { "name" = "somebody" }
 
100
        { "value" = "\"|exit 67\"" } }
 
101
 
79
102
(* Local Variables: *)
80
103
(* mode: caml       *)
81
104
(* End:             *)