Skip to content

Commit

Permalink
Parameterized goals #115
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 25, 2023
1 parent a6730ee commit 28e35f0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/parameterized_goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Should work as expected. `@doc` should just copy to instantiated goals.
- [ ] TODOS
- [ ] validate param name (regex)
- [x] handle + test w/ `@private`
- [ ] test w/ `@lib`
- [x] test w/ `@lib`
- [x] test w/ `@doc`
- [x] handle + test w/ `@reached_if`
- [ ] test w/ `@glob` (should be covered by `@params` at pos 3 check)
Expand Down
7 changes: 7 additions & 0 deletions tests/27_parameterized_goals.tush
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,10 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_11_reached_if.sh a
| goal 'b@salut' ...
| W is salut
| goal 'a' [empty].

$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_12_lib.sh a
| goal 'b@hi' ...
| in lib W=hi
| goal 'b@hello' ...
| in lib W=hello
| goal 'a' [empty].
13 changes: 13 additions & 0 deletions tests/27_parameterized_goals_12_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

@goal a
@depends_on b @args 'hi'
@depends_on b @args 'hello'

@lib
f() {
echo "in lib W=$W"
}

@goal b @params W
@use_lib
f

0 comments on commit 28e35f0

Please sign in to comment.