Skip to content

Commit

Permalink
Fix expanding bool
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 30, 2023
1 parent a3ca714 commit a9eedfe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
14 changes: 14 additions & 0 deletions eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,20 @@ func TestEvalExpand(t *testing.T) {
},
uint64(1234),
},
{
"{{ var }}",
map[string]any{
"var": false,
},
false,
},
{
"{{ var }}",
map[string]any{
"var": "false",
},
"false",
},
}
for i, tt := range tests {
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/k1LoW/curlreq v0.3.2
github.com/k1LoW/duration v1.2.0
github.com/k1LoW/exec v0.2.0
github.com/k1LoW/expand v0.9.0
github.com/k1LoW/expand v0.10.1
github.com/k1LoW/ghfs v1.1.0
github.com/k1LoW/grpcstub v0.13.0
github.com/k1LoW/grpcurlreq v0.1.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ github.com/k1LoW/duration v1.2.0 h1:qq1gWtPh7YROFyerBufVP+ATR11mOOHDInrcC/Xe/6A=
github.com/k1LoW/duration v1.2.0/go.mod h1:qUa0NptIiUl5EUsCc8wIiSaHuNjS4wmpYNMHp0l6pos=
github.com/k1LoW/exec v0.2.0 h1:b3mOuJtNgPWpvpdW/fRz64wDS7tskW/deAslTyCL9e8=
github.com/k1LoW/exec v0.2.0/go.mod h1:zW7HJpLP/ZndnbPrspA9Z3Q2CxHMK/PAUztlvZem+Ro=
github.com/k1LoW/expand v0.9.0 h1:9zRKIUuB7G6FRKvMR5PflG9yKTGYQFx6GDe4eESjhS8=
github.com/k1LoW/expand v0.9.0/go.mod h1:GC8ymCwOPNKKR6UVAc5UFpRMNV4JtbVxGJ4cyrJOwzg=
github.com/k1LoW/expand v0.10.1 h1:ru5/SnyElxVEm7KH8necW9fQqxq6i2BVcS7FeqRPpr8=
github.com/k1LoW/expand v0.10.1/go.mod h1:GC8ymCwOPNKKR6UVAc5UFpRMNV4JtbVxGJ4cyrJOwzg=
github.com/k1LoW/ghfs v1.1.0 h1:kbl2B9sX7FMuUMXWUbP2nVp6A9Ts/HMJ3aIsH9Xw2UU=
github.com/k1LoW/ghfs v1.1.0/go.mod h1:7XRzYncVd8Xm61Zhat47L0Sr5Xy1P3NiOvB2Q61x00E=
github.com/k1LoW/go-github-client/v53 v53.2.11 h1:3EpAdfUjTQUtjZF5vPY4dxTWs9NiP/uyqW15jbOqQ60=
Expand Down
2 changes: 2 additions & 0 deletions testdata/book/include_vars_included.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ steps:
// If the expanded value is to be passed as a string, enclose it in double quotes.
&& vars.k == "912345"
&& vars.l == "954321"
&& vars.m == false
&& vars.o == "false"
4 changes: 4 additions & 0 deletions testdata/book/include_vars_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ desc: Include vars (main)
vars:
intNumber: 12345
strNumber: "54321"
boolFalse: false
strFalse: "false"
steps:
-
include:
Expand All @@ -24,3 +26,5 @@ steps:
# If the expanded value is to be passed as a string, enclose it in double quotes.
k: '"9{{ vars.intNumber }}"'
l: '"9{{ vars.strNumber }}"'
m: '{{ vars.boolFalse }}'
o: '{{ vars.strFalse }}'

0 comments on commit a9eedfe

Please sign in to comment.