Skip to content

Allow to catch abnormal system exits #24

Description

@dasteg

at the moment it is possible to catch System.exit and assert on that. My code (some kind of script) only calls System.exit(1) if anything weird happened but does not call System.exit(0) if everything worked fine.

At the moment i can't test abnormal executions since i always get an AssertionError if no System.exit was called at all. It would be nice to have a method like SystemLambda.catchSystemExitOrDefault(Statement statement, int defaultValue) which returns the defaultValue if no System.exit was called at all. Then i could just assert for exit code 0 which happens normally and still fail if anything else happened.

does this make senses ?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions