Skip to content

Commit

Permalink
text: fix test for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Dec 20, 2024
1 parent 77e46fa commit e8bb1c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func TestPermissionList(t *testing.T) {

for _, tt := range tests {
t.Run(tt.Input, func(t *testing.T) {
var permissions Permissions
if err := json.Unmarshal([]byte(tt.Input), &permissions); err != nil {
var conf Configuration
if err := json.Unmarshal([]byte(`{"apps":[{"permissions":` + tt.Input + `}]}`), &conf); err != nil {
if tt.Error == "" {
t.Errorf("unexpected error: %s", err)
}
Expand All @@ -58,6 +58,8 @@ func TestPermissionList(t *testing.T) {
return
}

permissions := conf.Apps[0].Permissions

if permissions.Read != tt.Output.Read {
t.Errorf("expected Read: %t, got: %t", tt.Output.Read, permissions.Read)
}
Expand Down

0 comments on commit e8bb1c4

Please # to comment.