Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_aptpreferences.aug
1 module Test_aptpreferences =
2
3     let conf ="Explanation: Backport packages are never prioritary
4 Package: *
5 Pin: release a=backports
6 Pin-Priority: 100
7
8 # This is a comment
9 Explanation: My packages are the most prioritary
10 Package: *
11 Pin: release l=Raphink, v=3.0
12 Pin-Priority: 700
13
14 Package: liferea-data
15 Pin: version 1.4.26-4
16 Pin-Priority: 600
17
18 Package: *
19 Pin: origin packages.linuxmint.com
20 Pin-Priority: 700
21 "
22
23     test AptPreferences.lns get conf =
24        { "1"
25           { "Explanation"  = "Backport packages are never prioritary" }
26           { "Package"      = "*" }
27           { "Pin"          = "release"
28               { "a" = "backports" } }
29           { "Pin-Priority" = "100" } }
30        { "2"
31           { "#comment"     = "This is a comment" }
32           { "Explanation"  = "My packages are the most prioritary" }
33           { "Package"      = "*" }
34           { "Pin"          = "release"
35               { "l" = "Raphink" }
36               { "v" = "3.0"     } }
37           { "Pin-Priority" = "700" } }
38        { "3"
39           { "Package"      = "liferea-data" }
40           { "Pin"          = "version"
41               { "version" = "1.4.26-4" } }
42           { "Pin-Priority" = "600" } }
43        { "4"
44           { "Package"      = "*" }
45           { "Pin"          = "origin"
46               { "origin" = "packages.linuxmint.com" } }
47           { "Pin-Priority" = "700" } }
48
49 (*************************************************************************)
50
51     test AptPreferences.lns put "\n" after
52        set "/1/Package" "something-funny";
53        set "/1/Pin" "version";
54        set "/1/Pin/version" "1.2.3-4";
55        set "/1/Pin-Priority" "2000"
56     = "
57 Package: something-funny
58 Pin: version 1.2.3-4
59 Pin-Priority: 2000
60 "
61
62 (* Test: AptPreferences.pin
63      Spaces in origins are valid *)
64 test AptPreferences.pin get "Pin: release o=Quantum GIS project\n" =
65   { "Pin" = "release"
66     { "o" = "Quantum GIS project" } }