Skip to content

feat: render failing #[test] results as source diagnostics#788

Merged
ivov merged 1 commit into
mainfrom
test-failure-diagnostics
Jun 19, 2026
Merged

feat: render failing #[test] results as source diagnostics#788
ivov merged 1 commit into
mainfrom
test-failure-diagnostics

Conversation

@ivov

@ivov ivov commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Adds failure reporting for #[test] functions. A test may now return Result<(), error> and end in Err. When this happns, lis test renders the failure as a diagnostic that underlines the test and shows the returned error.

import "go:errors"

#[test]
fn parses_header() -> Result<(), error> {
    Err(errors.New("missing Content-Type"))
}

lis test reports:

  [error] test returned Err
   ╭─[http.test.lis:4:4]
 3 │ #[test]
 4 │ fn parses_header() -> Result<(), error> {
   ·    ──────┬──────
   ·          ╰── missing Content-Type
 5 │     Err(errors.New("missing Content-Type"))
   ╰────

Important

The test runner is work in progress, not ready for use yet!

Follow-up to #783

@ivov ivov merged commit e583f2c into main Jun 19, 2026
16 checks passed
@ivov ivov mentioned this pull request Jun 19, 2026
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