Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test/case/version-setup.bats
blob: fd50a87b87585d4de195a89a70f2f2b6d780ec7b (plain)
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
bats_require_minimum_version 1.5.0

export _DEVTOOLS_LIBRARY_DIR="${PWD}/src"

_pkgctl_version_setup() {
	source ${_DEVTOOLS_LIBRARY_DIR}/lib/version/setup.sh
	pkgctl_version_setup "$@"
}

setup_and_check_config() {
	pushd "test/fixture/version/setup/$1"
	shift
	_pkgctl_version_setup --force --no-check "$@"
	diff .nvchecker.toml nvchecker.assert.toml
	popd
}

@test "opt-no-force" {
	pushd test/fixture/version/setup/opt-no-force
	touch .nvchecker.toml
	run ! _pkgctl_version_setup --no-check "$@"
	popd
}

@test "opt-url" {
	pushd test/fixture/version/setup/opt-url
	_pkgctl_version_setup --no-check --force --url \
		"https://crates.io/api/v1/crates/shotgun/1.0/download" "$@"
	diff .nvchecker.toml nvchecker.assert.toml
	popd
}

@test "codeberg-tarball" {
	setup_and_check_config codeberg-tarball
}

@test "files.pythonhosted.org" {
	setup_and_check_config files.pythonhosted.org
}

@test "github-git" {
	setup_and_check_config github-git
}

@test "github-git-as-platform" {
	setup_and_check_config github-git-as-platform --prefer-platform-api
}

@test "github-git-v-prefix" {
	setup_and_check_config github-git-v-prefix
}

@test "github-git-v-prefix-as-platform" {
	setup_and_check_config github-git-v-prefix-as-platform --prefer-platform-api
}

@test "github-tarball" {
	setup_and_check_config github-tarball
}

@test "github-tarball-as-platform" {
	setup_and_check_config github-tarball-as-platform --prefer-platform-api
}

@test "gitlab-archlinux-tarball" {
	setup_and_check_config gitlab-archlinux-tarball
}

@test "gitlab-archlinux-tarball-as-platform" {
	setup_and_check_config gitlab-archlinux-tarball-as-platform --prefer-platform-api
}

@test "gitlab-git-multi-group" {
	setup_and_check_config gitlab-git-multi-group
}

@test "gitlab-git-multi-group-as-platform" {
	setup_and_check_config gitlab-git-multi-group-as-platform --prefer-platform-api
}

@test "gitlab-tarball-multi-group" {
	setup_and_check_config gitlab-tarball-multi-group
}

@test "gitlab-tarball-multi-group-as-platform" {
	setup_and_check_config gitlab-tarball-multi-group-as-platform --prefer-platform-api
}

@test "hackage-tarball" {
	setup_and_check_config hackage-tarball
}

@test "pkgbase-with-dot" {
	setup_and_check_config pkgbase-with-dot
}

@test "pypi.io" {
	setup_and_check_config pypi.io
}

@test "pypi.org" {
	setup_and_check_config pypi.org
}

@test "registry.npmjs.org" {
	setup_and_check_config registry.npmjs.org
}

@test "git-custom" {
	setup_and_check_config git-custom
}

@test "rubygems.org" {
	setup_and_check_config rubygems.org
}

@test "cpan.org" {
	setup_and_check_config cpan.org
}

@test "crates.io" {
	setup_and_check_config crates.io
}

@test "static.crates.io" {
	setup_and_check_config static.crates.io
}