From a6730eef2f03834e9b4a8da8f0e8ecbf4c41485f Mon Sep 17 00:00:00 2001 From: xonix Date: Wed, 25 Jan 2023 21:59:15 +0200 Subject: [PATCH] Parameterized goals #115 --- docs/parameterized_goals.md | 2 +- tests/27_parameterized_goals.tush | 10 +++++----- tests/27_parameterized_goals_2.sh | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/parameterized_goals.md b/docs/parameterized_goals.md index 029fc7e..2b6ac4f 100644 --- a/docs/parameterized_goals.md +++ b/docs/parameterized_goals.md @@ -121,7 +121,7 @@ Should work as expected. `@doc` should just copy to instantiated goals. - [ ] validate param name (regex) - [x] handle + test w/ `@private` - [ ] test w/ `@lib` -- [ ] test w/ `@doc` +- [x] test w/ `@doc` - [x] handle + test w/ `@reached_if` - [ ] test w/ `@glob` (should be covered by `@params` at pos 3 check) - [ ] README.md diff --git a/tests/27_parameterized_goals.tush b/tests/27_parameterized_goals.tush index 4858df3..70472d2 100644 --- a/tests/27_parameterized_goals.tush +++ b/tests/27_parameterized_goals.tush @@ -36,14 +36,14 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh e $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -l | Available goals: -| a -| c@hello +| a : doc a +| c@hello : doc c $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -la | Available goals: -| a -| b@hello -| c@hello +| a : doc a +| b@hello : doc b +| c@hello : doc c $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -d a | Resolved goals to reach for 'a': diff --git a/tests/27_parameterized_goals_2.sh b/tests/27_parameterized_goals_2.sh index 83993ff..3c9558b 100644 --- a/tests/27_parameterized_goals_2.sh +++ b/tests/27_parameterized_goals_2.sh @@ -1,11 +1,14 @@ @goal a +@doc 'doc a' @depends_on b @args 'hello' @goal b @params S @private +@doc 'doc b' @depends_on c @args S echo "$S world from b" @goal c @params S1 +@doc 'doc c' echo "$S1 world from c"