-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix platform detection override for lr docs (#2226)
- Loading branch information
1 parent
04819fd
commit 85173cf
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Mondoo, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"go.mondoo.com/cnquery/v9/providers-sdk/v1/lr/docs" | ||
"testing" | ||
) | ||
|
||
var defaultLrDocsEntry = &docs.LrDocsEntry{ | ||
Fields: map[string]*docs.LrDocsField{}, | ||
MinMondooVersion: "9.1.0", | ||
} | ||
|
||
func TestPlatformMapping(t *testing.T) { | ||
res := ensureDefaults("terraform.plan.configuration", defaultLrDocsEntry, "9.1.0") | ||
assert.Equal(t, "terraform-plan", res.Platform.Name[0]) | ||
|
||
res = ensureDefaults("terraform.plan.proposedChange", defaultLrDocsEntry, "9.1.0") | ||
assert.Equal(t, "terraform-plan", res.Platform.Name[0]) | ||
|
||
res = ensureDefaults("terraform.state.module", defaultLrDocsEntry, "9.1.0") | ||
assert.Equal(t, "terraform-state", res.Platform.Name[0]) | ||
|
||
res = ensureDefaults("terraform.block", defaultLrDocsEntry, "9.1.0") | ||
assert.Equal(t, "terraform-hcl", res.Platform.Name[0]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters