diff --git a/tests/data/grafts/graft.yaml b/tests/data/grafts/graft.yaml index 5d2efc4..ed09915 100644 --- a/tests/data/grafts/graft.yaml +++ b/tests/data/grafts/graft.yaml @@ -12,12 +12,14 @@ variables: example_url: ${repos}/example.git groups: - core: - - deps::framework - - core + prebuilt-group: + - prebuilt + - prebuilt2 trees: graft: ${example_url} core: ${repos}/core.git prebuilt: path: trees/prebuilt + prebuilt2: + path: trees/prebuilt diff --git a/tests/integration_test.rs b/tests/integration_test.rs index f8027b6..06f69f0 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1086,6 +1086,26 @@ fn cmd_exec_garden_with_grafted_trees() { } } +/// Test the use of graft:: tree references when querying for groups. +#[test] +fn cmd_exec_grafted_group() { + // prebuilt-group has two trees pointing to the same prebuilt path. + let output = garden_capture(&[ + "--quiet", + "--chdir", + "tests/data", + "exec", + "graft::prebuilt-group", + "pwd", + ]); + let output_len = output.lines().count(); + assert_eq!(output_len, 2); + + for line in output.lines() { + assert!(line.ends_with("/tests/data/trees/prebuilt")); + } +} + /// Test the use of $shell variables in commands. /// $shell variables are not expanded by garden. /// ${garden} variables are expanded.