Skip to content

testscript: Expose Environ() to custom commands#251

Open
abhinav wants to merge 1 commit intorogpeppe:masterfrom
abhinav:testscript-environ
Open

testscript: Expose Environ() to custom commands#251
abhinav wants to merge 1 commit intorogpeppe:masterfrom
abhinav:testscript-environ

Conversation

@abhinav
Copy link
Copy Markdown
Contributor

@abhinav abhinav commented May 11, 2024

This adds an Environ method to TestScript
that looks and acts similarly to os.Environ.

This gives further visibility into the test script state
to custom command implementations,
allowing them to implement functionality that is otherwise limited
only to the built-in commands.

For example, combining this and MkAbs, a custom command can use os/exec
to run a command with the same environment as the test script,
with different behavior than the built-in TestScript.Exec method.

This adds an Environ method to TestScript
that looks and acts similarly to os.Environ.

This gives further visibility into the test script state
to custom command implementations,
allowing them to implement functionality that is otherwise limited
only to the built-in commands.

For example, combining this and MkAbs, a custom command can use os/exec
to run a command with the same environment as the test script,
with different behavior than the built-in TestScript.Exec method.
@abhinav
Copy link
Copy Markdown
Contributor Author

abhinav commented Jul 12, 2024

Gentle bump
@rogpeppe, @mvdan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant