MCPcopy Create free account
hub / github.com/archlinux/alpm / create

Function create

alpm-db/tests/desc_cli.rs:225–333  ·  view source on GitHub ↗
(#[case] schema: DbDescSchema)

Source from the content-addressed store, hash-verified

223 #[case::v1(DbDescSchema::V1(SchemaVersion::new(Version::new(1, 0, 0))))]
224 #[case::v2(DbDescSchema::V2(SchemaVersion::new(Version::new(2, 0, 0))))]
225 fn create(#[case] schema: DbDescSchema) -> TestResult {
226 let tmp = tempdir()?;
227 let out = tmp.path().join("desc").to_string_lossy().to_string();
228
229 let (version_flag, _data) = super::schema_fixture(&schema);
230
231 // Common arguments shared between v1 and v2
232 let mut args = vec![
233 "create",
234 version_flag,
235 "--name",
236 "foo",
237 "--version",
238 "1.0.0-1",
239 "--base",
240 "foo",
241 "--description",
242 "An example package",
243 "--url",
244 "https://example.org",
245 "--arch",
246 "x86_64",
247 "--builddate",
248 "1733737242",
249 "--installdate",
250 "1733737243",
251 "--packager",
252 "Foobar McFooface <foobar@mcfooface.org>",
253 "--size",
254 "123",
255 "--groups",
256 "utils",
257 "--groups",
258 "cli",
259 "--reason",
260 "1",
261 "--license",
262 "MIT",
263 "--license",
264 "Apache-2.0",
265 "--validation",
266 "sha256",
267 "--validation",
268 "pgp",
269 "--replaces",
270 "pkg-old",
271 "--depends",
272 "glibc",
273 "--optdepends",
274 "optpkg: description of optpkg",
275 "--conflicts",
276 "foo-old",
277 "--provides",
278 "foo-virtual",
279 ];
280
281 // Add v2-only field
282 if matches!(schema, DbDescSchema::V2(_)) {

Callers 6

v2_fileFunction · 0.70
dir_with_entriesFunction · 0.70
create_fileFunction · 0.50
create_from_dirFunction · 0.50
format_outputFunction · 0.50

Calls 7

from_strFunction · 0.85
schema_fixtureFunction · 0.70
joinMethod · 0.45
pathMethod · 0.45
nameMethod · 0.45
lenMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected