terraform/lang/funcs
Alisdair McDiarmid df626e898c lang/funcs: Fix alltrue/anytrue with unknowns
The alltrue/anytrue functions did not correctly handle unknown values.
This commit changes these functions so that the result is unknown if:

- The list argument is unknown
- For alltrue: any elements are unknown
- For anytrue: any elements are unknown and no known elements are true

The last change is a little subtle, so there are test cases to cover it
specifically. Examples:

- anytrue(unknown) -> unknown
- anytrue(false, unknown) -> unknown
- anytrue(false, unknown, true) -> true
2020-12-10 11:36:14 -05:00
..
testdata lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
cidr.go add test cases and remove no-longer-needed validation 2020-07-08 13:53:54 -04:00
cidr_test.go add test cases and remove no-longer-needed validation 2020-07-08 13:53:54 -04:00
collection.go lang/funcs: Fix alltrue/anytrue with unknowns 2020-12-10 11:36:14 -05:00
collection_test.go lang/funcs: Fix alltrue/anytrue with unknowns 2020-12-10 11:36:14 -05:00
conversion.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
conversion_test.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
crypto.go lang/funcs: Add support for OpenSSH RSA key format 2020-06-03 10:50:38 -04:00
crypto_test.go lang/funcs: Add support for OpenSSH RSA key format 2020-06-03 10:50:38 -04:00
datetime.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
datetime_test.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
defaults.go lang/funcs: staticcheck 2020-12-02 13:59:19 -05:00
defaults_test.go lang/funcs: Experimental "defaults" function 2020-11-13 17:27:20 -08:00
encoding.go lang/funcs: Rename the base64 character encoding functions 2020-10-21 10:56:56 -07:00
encoding_test.go lang/funcs: Rename the base64 character encoding functions 2020-10-21 10:56:56 -07:00
filesystem.go lang/funcs: Filesystem functions hint about dynamically-generated files 2020-06-24 09:02:38 -07:00
filesystem_test.go lang/funcs: Filesystem functions hint about dynamically-generated files 2020-06-24 09:02:38 -07:00
number.go remove old funcs code 2020-03-03 15:23:58 -05:00
number_test.go remove old funcs code 2020-03-03 15:23:58 -05:00
string.go remove old funcs code 2020-03-03 15:23:58 -05:00
string_test.go remove old funcs code 2020-03-03 15:23:58 -05:00