Skip to content

Commit

Permalink
Minor updates to test after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones committed Jun 16, 2023
1 parent a763b98 commit 6934476
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 152 deletions.
44 changes: 22 additions & 22 deletions interpreter/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,9 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a[1]['two']`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(
decls.IntType,
decls.MapType(decls.StringType, decls.BoolType))),
decls.NewVariable("a", types.NewMapType(
types.IntType,
types.NewMapType(types.StringType, types.BoolType))),
},
in: map[string]any{
"a": map[int64]any{
Expand All @@ -903,9 +903,9 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a[1][2][3]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(
decls.IntType,
decls.MapType(decls.DynType, decls.DynType))),
decls.NewVariable("a", types.NewMapType(
types.IntType,
types.NewMapType(types.DynType, types.DynType))),
},
in: map[string]any{
"a": map[int64]any{
Expand All @@ -931,9 +931,9 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a[1][2][a[1][1]]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(
decls.IntType,
decls.MapType(decls.DynType, decls.DynType))),
decls.NewVariable("a", types.NewMapType(
types.IntType,
types.NewMapType(types.DynType, types.DynType))),
},
in: map[string]any{
"a": map[int64]any{
Expand Down Expand Up @@ -967,8 +967,8 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `true ? a : b`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.StringType),
decls.NewVariable("b", decls.StringType),
decls.NewVariable("a", types.StringType),
decls.NewVariable("b", types.StringType),
},
in: map[string]any{
"a": "hello",
Expand All @@ -983,8 +983,8 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `(a.size() != 0 ? a : b)[0]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.ListType(decls.StringType)),
decls.NewVariable("b", decls.ListType(decls.StringType)),
decls.NewVariable("a", types.NewListType(types.StringType)),
decls.NewVariable("b", types.NewListType(types.StringType)),
},
in: map[string]any{
"a": []string{"hello", "world"},
Expand All @@ -1007,7 +1007,7 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a.?b.c`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.MapType(decls.StringType, decls.StringType))),
decls.NewVariable("a", types.NewMapType(types.StringType, types.NewMapType(types.StringType, types.StringType))),
},
in: map[string]any{
"a": map[string]any{"b": map[string]any{"c": "world"}},
Expand All @@ -1023,7 +1023,7 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a.?b.c`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.MapType(decls.StringType, decls.StringType))),
decls.NewVariable("a", types.NewMapType(types.StringType, types.NewMapType(types.StringType, types.StringType))),
},
in: map[string]any{
"a": map[string]any{"b": map[string]string{"random": "value"}},
Expand All @@ -1039,7 +1039,7 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `a.b.c`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.MapType(decls.StringType, decls.StringType))),
decls.NewVariable("a", types.NewMapType(types.StringType, types.NewMapType(types.StringType, types.StringType))),
},
in: map[string]any{
"a": map[string]any{"b": map[string]any{"c": "world"}},
Expand All @@ -1055,8 +1055,8 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `m[has(a.b)]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.StringType)),
decls.NewVariable("m", decls.MapType(decls.BoolType, decls.StringType)),
decls.NewVariable("a", types.NewMapType(types.StringType, types.StringType)),
decls.NewVariable("m", types.NewMapType(types.BoolType, types.StringType)),
},
in: map[string]any{
"a": map[string]string{"b": ""},
Expand All @@ -1067,8 +1067,8 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `m[?has(a.b)]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.StringType)),
decls.NewVariable("m", decls.MapType(decls.BoolType, decls.StringType)),
decls.NewVariable("a", types.NewMapType(types.StringType, types.StringType)),
decls.NewVariable("m", types.NewMapType(types.BoolType, types.StringType)),
},
in: map[string]any{
"a": map[string]string{"b": ""},
Expand All @@ -1079,8 +1079,8 @@ func TestAttributeStateTracking(t *testing.T) {
{
expr: `m[?has(a.b.c)]`,
vars: []*decls.VariableDecl{
decls.NewVariable("a", decls.MapType(decls.StringType, decls.DynType)),
decls.NewVariable("m", decls.MapType(decls.BoolType, decls.StringType)),
decls.NewVariable("a", types.NewMapType(types.StringType, types.DynType)),
decls.NewVariable("m", types.NewMapType(types.BoolType, types.StringType)),
},
in: partialActivation(
map[string]any{
Expand Down
Loading

0 comments on commit 6934476

Please sign in to comment.