Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Mar 3, 2024
1 parent 3186908 commit 3e00a29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ $ tree .
- [x] `cd` opt (files live under a subdir)
- [x] Create destination path if needed
- [x] OS filter
- [x] CI/CD
- [ ] Validate dot file
- [ ] Tests
- [ ] CI/CD
10 changes: 8 additions & 2 deletions dot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,16 @@ func TestEvalTemplateString(t *testing.T) {

func TestEvalTemplate(t *testing.T) {
curOs := runtime.GOOS
var otherOs string
if curOs == "darwin" {
otherOs = "linux"
} else {
otherOs = "darwin"
}
with := map[string]string {
"t1": "{{if eq .Os \"" + curOs + "\"}}it works{{end}}",
"t2": "{{if eq .Os \"linux\"}}must not be this{{end}}",
"t3": "{{if eq .Os \"linux\"}}must not be this{{else}}else{{end}}",
"t2": "{{if eq .Os \"" + otherOs + "\"}}must not be this{{end}}",
"t3": "{{if eq .Os \"" + otherOs + "\"}}must not be this{{else}}else{{end}}",
}

res := evalTemplate(with)
Expand Down

0 comments on commit 3e00a29

Please sign in to comment.