Skip to content

Commit

Permalink
Adding to the documentation for the custom known value check (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Jan 15, 2024
1 parent 1e51693 commit 3d4acf4
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,26 @@ func StringValueMatch(value string) StringValue {
}
}
```

## `CheckValue` Method Implementation

The `other` parameter passed to the `CheckValue` method is one of the following types:

* bool
* map[string]any
* []any
* string

-> **Note:** Numerical values will be of type `json.Number`, with an underlying type of `string`.

Refer to the following built-in known value checks for implementations that handle the different types that can be passed to the `CheckValue` method in the `other` parameter:

* [BoolValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#BoolValueExact)
* [Float64ValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#Float64ValueExact)
* [Int64ValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#Int64ValueExact)
* [ListValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#ListValueExact)
* [MapValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#MapValueExact)
* [NumberValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#NumberValueExact)
* [ObjectValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#ObjectValueExact)
* [SetValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#SetValueExact)
* [StringValueExact](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#StringValueExact)

0 comments on commit 3d4acf4

Please sign in to comment.