File: test-parse-package-name.sh

package info (click to toggle)
tla 1.3.5%2Bdfsg1-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 22,292 kB
  • ctags: 11,952
  • sloc: ansic: 149,771; sh: 16,009; xml: 2,689; lisp: 1,927; makefile: 1,064; cpp: 363; tcl: 230; awk: 48; sed: 25
file content (107 lines) | stat: -rw-r--r-- 3,506 bytes parent folder | download | duplicates (8)
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
#!/bin/sh
# -*- mode: sh; coding: utf-8 -*-
# Test parse-package-name
# Copyright © 2003 Colin Walters <walters@verbum.org>
#
# See the file "COPYING" for further information about
# the copyright and warranty status of this work.

set -e

arg0="$0"
srcdir=`dirname "$arg0"`

. ${srcdir}/test-framework

setup_workdir

test_class "parse-package-name"

begin_test "foo--bar--0--patch-1"
name="foo--bar--0--patch-1"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo'
test "${branch}" = 'bar'
test "${version}" = '0'
test "${patchlvl}" = 'patch-1'
end_test

begin_test "foo-bar--baz--0--patch-1"
name="foo-bar--baz--0--patch-1"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo-bar'
test "${branch}" = 'baz'
test "${version}" = '0'
test "${patchlvl}" = 'patch-1'
end_test

begin_test "foo-bar--baz-whee--0--patch-1"
name="foo-bar--baz-whee--0--patch-1"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo-bar'
test "${branch}" = 'baz-whee'
test "${version}" = '0'
test "${patchlvl}" = 'patch-1'
end_test

begin_test "foo-bar--baz-whee--3.1--patch-1"
name="foo-bar--baz-whee--3.1--patch-1"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo-bar'
test "${branch}" = 'baz-whee'
test "${version}" = '3.1'
test "${patchlvl}" = 'patch-1'
end_test

begin_test "foo-bar--baz-whee--3.1.3--patch-1"
name="foo-bar--baz-whee--3.1.3--patch-1"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo-bar'
test "${branch}" = 'baz-whee'
test "${version}" = '3.1.3'
test "${patchlvl}" = 'patch-1'
end_test

begin_test "foo-bar--baz-whee--3.1.3--base-0"
name="foo-bar--baz-whee--3.1.3--base-0"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'foo-bar'
test "${branch}" = 'baz-whee'
test "${version}" = '3.1.3'
test "${patchlvl}" = 'base-0'
end_test

begin_test "b33f--baz-whee-foo-bar--3.1.3--base-0"
name="b33f--baz-whee-foo-bar--3.1.3--base-0"
category=$(tla parse-package-name -c "${name}" $revision)
branch=$(tla parse-package-name -b "${name}" $revision)
version=$(tla parse-package-name -v "${name}" $revision)
patchlvl=$(tla parse-package-name -l "${name}" $revision)
test "${category}" = 'b33f'
test "${branch}" = 'baz-whee-foo-bar'
test "${version}" = '3.1.3'
test "${patchlvl}" = 'base-0'
end_test

clean_workdir

# tag: Colin Walters Tue, 16 Sep 2003 22:16:32 -0400 (test-parse-package-name.sh)
#