summaryrefslogtreecommitdiff
path: root/ops_test.go
diff options
context:
space:
mode:
authorAlisdair McDiarmid <alisdair@users.noreply.github.com>2020-11-26 10:59:16 -0500
committerAlisdair McDiarmid <alisdair@users.noreply.github.com>2020-11-26 10:59:16 -0500
commitd0cb134fec46161a39550b3a2639bb09fc9ea706 (patch)
tree1cd4998b379a439b2184e8f0e66bd406cd7c4e7a /ops_test.go
parent3bb0644ad8b106c43c9868fd6501b5a5456213b4 (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.go8
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"),
}),