Skip to content

Commit

Permalink
For exported
Browse files Browse the repository at this point in the history
  • Loading branch information
hyorigo committed Jul 21, 2023
1 parent becf53e commit d27f6f6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,24 @@ func TestMachine_DisableOutputConversion(t *testing.T) {
return
}
}

// for export
{
m := getMac(`b = a << 2`)
res, err := m.Run()
if err != nil {
t.Errorf("expected no error for output, got %v", err)
}
if exp := starlet.StringAnyMap(map[string]interface{}{"b": starlark.MakeInt(400)}); !expectEqualStringAnyMap(t, res, exp) {
t.Errorf("expected result for output %v, got %v", exp, res)
return
}
ed := m.Export()
if exp := starlet.StringAnyMap(map[string]interface{}{"a": starlark.MakeInt(100), "b": starlark.MakeInt(400)}); !expectEqualStringAnyMap(t, ed, exp) {
t.Errorf("expected export for output %v, got %v", exp, ed)
return
}
}
}

func TestMachine_DisableBothConversion(t *testing.T) {
Expand Down

0 comments on commit d27f6f6

Please sign in to comment.