/usr/share/gocode/src/pault.ag/go/debian/control/dsc_test.go is in golang-pault-go-debian-dev 0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | /* {{{ Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2015
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. }}} */
package control_test
import (
"bufio"
"strings"
"testing"
"pault.ag/go/debian/control"
)
/*
*
*/
func TestDSCParse(t *testing.T) {
// Test DSC {{{
reader := bufio.NewReader(strings.NewReader(`Format: 3.0 (quilt)
Source: fbautostart
Binary: fbautostart
Architecture: any
Version: 2.718281828-1
Maintainer: Paul Tagliamonte <paultag@ubuntu.com>
Homepage: https://launchpad.net/fbautostart
Standards-Version: 3.9.3
Vcs-Browser: http://git.debian.org/?p=collab-maint/fbautostart.git
Vcs-Git: git://git.debian.org/collab-maint/fbautostart.git
Build-Depends: debhelper (>= 9)
Package-List:
fbautostart deb misc optional arch=any
Checksums-Sha1:
bc36310c15edc9acf48f0a1daf548bcc6f861372 92748 fbautostart_2.718281828.orig.tar.gz
eaed7f053dce48d4ad4e442bbb0da73ea1181a26 2356 fbautostart_2.718281828-1.debian.tar.xz
Checksums-Sha256:
bb2fdfd4a38505905222ee02d8236a594bdf6eaefca23462294cacda631745c1 92748 fbautostart_2.718281828.orig.tar.gz
f7186d1bebde403527b5b3fd80406decaaf295366206667d5b402da962f0b772 2356 fbautostart_2.718281828-1.debian.tar.xz
Files:
06495f9b23b1c9b1bf35c2346cb48f63 92748 fbautostart_2.718281828.orig.tar.gz
f58c0e0bf4d56461e776232484c07301 2356 fbautostart_2.718281828-1.debian.tar.xz
`))
// }}}
c, err := control.ParseDsc(reader, "")
isok(t, err)
assert(t, c != nil)
assert(t, c.Format == "3.0 (quilt)")
assert(t, c.Source == "fbautostart")
assert(t, len(c.Maintainers()) == 1)
assert(t, c.Maintainers()[0] == "Paul Tagliamonte <paultag@ubuntu.com>")
assert(t, c.Maintainer == "Paul Tagliamonte <paultag@ubuntu.com>")
assert(t, c.Version.Version == "2.718281828")
assert(t, c.Version.Revision == "1")
assert(t, c.StandardsVersion == "3.9.3")
assert(t, c.Homepage == "https://launchpad.net/fbautostart")
}
func TestOpenPGPDSCParse(t *testing.T) {
// Test OpenPGP DSC {{{
reader := bufio.NewReader(strings.NewReader(`-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 3.0 (quilt)
Source: fbautostart
Binary: fbautostart
Architecture: any
Version: 2.718281828-1
Maintainer: Paul Tagliamonte <paultag@ubuntu.com>
Homepage: https://launchpad.net/fbautostart
Standards-Version: 3.9.3
Vcs-Browser: http://git.debian.org/?p=collab-maint/fbautostart.git
Vcs-Git: git://git.debian.org/collab-maint/fbautostart.git
Build-Depends: debhelper (>= 9)
Package-List:
fbautostart deb misc optional
Checksums-Sha1:
bc36310c15edc9acf48f0a1daf548bcc6f861372 92748 fbautostart_2.718281828.orig.tar.gz
af4f1950dd8ed5bb7bd8952c8c00ffdd42eadb46 2396 fbautostart_2.718281828-1.debian.tar.gz
Checksums-Sha256:
bb2fdfd4a38505905222ee02d8236a594bdf6eaefca23462294cacda631745c1 92748 fbautostart_2.718281828.orig.tar.gz
49f402ff3a72653e63542037be9f4da56e318e412d26d4154f9336fb88df3519 2396 fbautostart_2.718281828-1.debian.tar.gz
Files:
06495f9b23b1c9b1bf35c2346cb48f63 92748 fbautostart_2.718281828.orig.tar.gz
3b0e6dd201d5036f6d1b80f0ac4e1e7d 2396 fbautostart_2.718281828-1.debian.tar.gz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCAAGBQJP3sSmAAoJEJcyXdj5/dUG+0MQAMg7Naio+BQpssqth2p+4j7L
Z87vdCd1fzRszRRptyBRbmTzTAzWPCNn15u5R+edCy7tyXi1TTty5QO/gU6p11mK
wJ4EewJuagYcqZpiL6/6sGyDoLBdz5O0+TwmOp8M+mwKrHzU3kyyuKEtAyvhnsSv
M6PaXU5hFaImwg+EZ1kJnzzxgM9UoJZ1Muib5mwS13FuH2uYU47t4h1vzgEsWDMm
BaZoPJZhpmNksT+phPo1nlYaGg2M3bSyFrtFmWi9U+qih3l6hQ3N+6gNOTithccY
lLf0PoEQiOu1ymbShsKtKkH2B7unkGIuyp3ElHt+XdRIhcoIrSu76RdLA2g8GLya
eaoif0U/n3FbHRwE61uGiP6ykFRr6Lsih0Um61XLtGFHmtc/78+TknzoK2p98rDv
vopNzdx0vrNOuqqJIQ+cjt9lCw493TxEo0uz+Ll0bhknLCByDgcA0AzciYoSpR+B
4KRQJwJAesFXhNueHCkYq8dsxSsIugKaEvBf7Z94bWam+AyVzakNMUF9ehp6KYhF
jKL78j4v9XEo994zqhqTIuzA9xUoAXikzRrb97UbK5oqde4/G95/SotM50NgfQ2k
0DAgtrREBQGzSPSMCbWBJxbjEETsEBlxRkpceNwuE+kZ5HYkpPEzBWuugGsDThwx
5Q/HJMGB+4wV0I0IbEuI
=RGXD
-----END PGP SIGNATURE-----
`))
// }}}
c, err := control.ParseDsc(reader, "")
isok(t, err)
assert(t, c != nil)
assert(t, c.Format == "3.0 (quilt)")
assert(t, c.Source == "fbautostart")
assert(t, len(c.Maintainers()) == 1)
assert(t, c.Maintainers()[0] == "Paul Tagliamonte <paultag@ubuntu.com>")
assert(t, c.Maintainer == "Paul Tagliamonte <paultag@ubuntu.com>")
assert(t, c.Version.Version == "2.718281828")
assert(t, c.Version.Revision == "1")
assert(t, c.StandardsVersion == "3.9.3")
assert(t, c.Homepage == "https://launchpad.net/fbautostart")
}
func TestDSCArchAllParse(t *testing.T) {
// Test DSC (arch: any) {{{
reader := bufio.NewReader(strings.NewReader(`Format: 3.0 (quilt)
Source: fbautostart
Binary: fbautostart
Architecture: any
Version: 2.718281828-1
Maintainer: Paul Tagliamonte <paultag@ubuntu.com>
Homepage: https://launchpad.net/fbautostart
Standards-Version: 3.9.3
Vcs-Browser: http://git.debian.org/?p=collab-maint/fbautostart.git
Vcs-Git: git://git.debian.org/collab-maint/fbautostart.git
Build-Depends: debhelper (>= 9)
Package-List:
fbautostart deb misc optional arch=any
Checksums-Sha1:
bc36310c15edc9acf48f0a1daf548bcc6f861372 92748 fbautostart_2.718281828.orig.tar.gz
eaed7f053dce48d4ad4e442bbb0da73ea1181a26 2356 fbautostart_2.718281828-1.debian.tar.xz
Checksums-Sha256:
bb2fdfd4a38505905222ee02d8236a594bdf6eaefca23462294cacda631745c1 92748 fbautostart_2.718281828.orig.tar.gz
f7186d1bebde403527b5b3fd80406decaaf295366206667d5b402da962f0b772 2356 fbautostart_2.718281828-1.debian.tar.xz
Files:
06495f9b23b1c9b1bf35c2346cb48f63 92748 fbautostart_2.718281828.orig.tar.gz
f58c0e0bf4d56461e776232484c07301 2356 fbautostart_2.718281828-1.debian.tar.xz
`))
// }}}
c, err := control.ParseDsc(reader, "")
isok(t, err)
assert(t, !c.HasArchAll())
// Test DSC (arch: any all) {{{
reader = bufio.NewReader(strings.NewReader(`Format: 3.0 (quilt)
Source: fbautostart
Binary: fbautostart
Architecture: any all
Version: 2.718281828-1
Maintainer: Paul Tagliamonte <paultag@ubuntu.com>
Homepage: https://launchpad.net/fbautostart
Standards-Version: 3.9.3
Vcs-Browser: http://git.debian.org/?p=collab-maint/fbautostart.git
Vcs-Git: git://git.debian.org/collab-maint/fbautostart.git
Build-Depends: debhelper (>= 9)
Package-List:
fbautostart deb misc optional arch=any
Checksums-Sha1:
bc36310c15edc9acf48f0a1daf548bcc6f861372 92748 fbautostart_2.718281828.orig.tar.gz
eaed7f053dce48d4ad4e442bbb0da73ea1181a26 2356 fbautostart_2.718281828-1.debian.tar.xz
Checksums-Sha256:
bb2fdfd4a38505905222ee02d8236a594bdf6eaefca23462294cacda631745c1 92748 fbautostart_2.718281828.orig.tar.gz
f7186d1bebde403527b5b3fd80406decaaf295366206667d5b402da962f0b772 2356 fbautostart_2.718281828-1.debian.tar.xz
Files:
06495f9b23b1c9b1bf35c2346cb48f63 92748 fbautostart_2.718281828.orig.tar.gz
f58c0e0bf4d56461e776232484c07301 2356 fbautostart_2.718281828-1.debian.tar.xz
`))
// }}}
c, err = control.ParseDsc(reader, "")
isok(t, err)
assert(t, c.HasArchAll())
}
// vim: foldmethod=marker
|