Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for exception stdlib. #480

Closed
marzipankaiser opened this issue Jun 4, 2024 · 1 comment · Fixed by #775
Closed

Tests for exception stdlib. #480

marzipankaiser opened this issue Jun 4, 2024 · 1 comment · Fixed by #775
Labels
area:stdlib area:tests feature New feature or request good first issue Good for newcomers

Comments

@marzipankaiser
Copy link
Contributor

There are currently no tests for the exception part of the stdlib.
(As noticed in #479).

@jiribenes
Copy link
Contributor

The resulting tests should probably go to examples/stdlib/exceptions.
There might be some other tests in examples/pos which just test stdlib exceptions, those should then be moved, I guess.

@jiribenes jiribenes added the good first issue Good for newcomers label Sep 4, 2024
@jiribenes jiribenes linked a pull request Jan 15, 2025 that will close this issue
jiribenes pushed a commit that referenced this issue Jan 15, 2025
## Motivation
Resolves #480
This module demonstrates exception handling combinators in Effekt using
a simple, focused example. By showcasing custom exception handling
(`TestException`) with different strategies (default handling, ignoring,
reporting, finalizing), it provides a practical guide for understanding
these features.

## Changes
- Introduced `TestException` as a custom exception type, independent of
other exceptions like `OutOfBounds`.
- Added `generalOperation`, which raises a `TestException` for invalid
input or returns a string.
- Included tests for handling exceptions with:
  - Default behavior
  - Ignoring exceptions
  - Reporting exceptions
  - Finalization hooks
  - "Reifying" with Results

## Testing
The examples are self-contained in the `main` function, covering all
provided exception-handling strategies. Each approach is tested and
outputs expected results for validation (`combinators.check`).
EveEme pushed a commit to EveEme/effekt that referenced this issue Jan 20, 2025
## Motivation
Resolves effekt-lang#480
This module demonstrates exception handling combinators in Effekt using
a simple, focused example. By showcasing custom exception handling
(`TestException`) with different strategies (default handling, ignoring,
reporting, finalizing), it provides a practical guide for understanding
these features.

## Changes
- Introduced `TestException` as a custom exception type, independent of
other exceptions like `OutOfBounds`.
- Added `generalOperation`, which raises a `TestException` for invalid
input or returns a string.
- Included tests for handling exceptions with:
  - Default behavior
  - Ignoring exceptions
  - Reporting exceptions
  - Finalization hooks
  - "Reifying" with Results

## Testing
The examples are self-contained in the `main` function, covering all
provided exception-handling strategies. Each approach is tested and
outputs expected results for validation (`combinators.check`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:stdlib area:tests feature New feature or request good first issue Good for newcomers
Projects
Development

Successfully merging a pull request may close this issue.

2 participants