diff options
| author | Alisdair McDiarmid <alisdair@users.noreply.github.com> | 2020-11-26 10:59:16 -0500 |
|---|---|---|
| committer | Alisdair McDiarmid <alisdair@users.noreply.github.com> | 2020-11-26 10:59:16 -0500 |
| commit | d0cb134fec46161a39550b3a2639bb09fc9ea706 (patch) | |
| tree | 1cd4998b379a439b2184e8f0e66bd406cd7c4e7a /ops_test.go | |
| parent | 3bb0644ad8b106c43c9868fd6501b5a5456213b4 (diff) | |
Fix panic traversing marked list
We need to unmark the result of HasIndex in order to compare it with
true or false without a panic.
Diffstat (limited to 'ops_test.go')
| -rw-r--r-- | ops_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ops_test.go b/ops_test.go index 39b748f..82eee9b 100644 --- a/ops_test.go +++ b/ops_test.go @@ -41,6 +41,14 @@ func TestApplyPath(t *testing.T) { ``, }, { + cty.ListVal([]cty.Value{ + cty.StringVal("hello"), + }).Mark("x"), + (cty.Path)(nil).Index(cty.NumberIntVal(0)), + cty.StringVal("hello").Mark("x"), + ``, + }, + { cty.TupleVal([]cty.Value{ cty.StringVal("hello"), }), |
