Skip to content

Add testgen CLI to generate moon ide cram tests#2

Open
bzy-debug wants to merge 2 commits intomainfrom
zhiyuan/testgen
Open

Add testgen CLI to generate moon ide cram tests#2
bzy-debug wants to merge 2 commits intomainfrom
zhiyuan/testgen

Conversation

@bzy-debug
Copy link

@bzy-debug bzy-debug commented Feb 28, 2026

This PR adds a moonbit CLI testgen to generate moon ide subcommand cram tests of a moonbit project.

Given a moonbit project, testgen will generate following files:

├── dune # a dune file to enable cram tests in current folder
├── generated_find_references.t # tests of moon ide find-references
├── generated_hover.t # tests of moon ide hover
├── generated_outline.t # tests of moon ide outline
├── generated_peek_def.t # tests of moon ide peek-def
├── generated_rename.t # tests of moon ide rename

testgen uses moonbitlang/parser to parse every moonbit file, collect all testable localtions from ast nodes (lident, uident, dot_ident, etc.), then output serveral .t files for testing.

The generated tests also finds the bug that's already revealed by 52afcd1:

  $ moon ide hover Item --loc sample.mbt:3:10
  No hover information found for symbol 'Item' at sample.mbt:3:10
  [1]

Open with Devin

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@bzy-debug
Copy link
Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@bzy-debug bzy-debug marked this pull request as draft February 28, 2026 09:12
@bzy-debug
Copy link
Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@bzy-debug bzy-debug force-pushed the zhiyuan/testgen branch 2 times, most recently from 4503000 to e33602c Compare March 2, 2026 02:07
@bzy-debug
Copy link
Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@bzy-debug bzy-debug marked this pull request as ready for review March 2, 2026 03:15
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@bzy-debug bzy-debug requested a review from bobzhang March 2, 2026 06:32
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

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