Skip to content

Commit

Permalink
test(parse): include global property in parse test
Browse files Browse the repository at this point in the history
When testing `parser.parse`, include a global property in the input and
expected parseTree.
  • Loading branch information
subpop committed Dec 15, 2023
1 parent ef461d5 commit e69822f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,19 @@ func TestParse(t *testing.T) {
},
},
{
input: "[user]\nname=root\nshell[unix]=/bin/bash\nshell[win32]=PowerShell.exe\n[user]\nname=admin\nshell[unix]=/bin/bash\nshell[win32]=PowerShell.exe",
input: "source=passwd\n[user]\nname=root\nshell[unix]=/bin/bash\nshell[win32]=PowerShell.exe\n[user]\nname=admin\nshell[unix]=/bin/bash\nshell[win32]=PowerShell.exe",
want: parseTree{
global: newSection(""),
global: section{
name: "",
props: map[string]property{
"source": {
key: "source",
vals: map[string][]string{
"": {"passwd"},
},
},
},
},
sections: map[string][]section{
"user": {
{
Expand Down

0 comments on commit e69822f

Please sign in to comment.