mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #200] [MERGED] test: add unit tests for pkg/terminal package #230
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/200
Author: @mason5052
Created: 3/12/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @asdek
Base:
feature/next_release← Head:test/terminal-output-coverage📝 Commits (2)
06c8ce4test: add unit tests for pkg/terminal package335541aFix cancellation tests to verify context.Canceled exactly📊 Changes
1 file changed (+180 additions, -0 deletions)
View changed files
➕
backend/pkg/terminal/output_test.go(+180 -0)📄 Description
Description of Change
Problem: The
pkg/terminalpackage has no unit test coverage. This package provides terminal output formatting, markdown rendering, JSON printing, and interactive user prompts used by the CLI installer and testers.Solution: Add 21 unit tests covering IsMarkdownContent detection (headers, code blocks, bold, links, lists, plain text), InteractivePromptContext (input reading, whitespace trimming, context cancellation), GetYesNoInputContext (yes/no variants, case insensitivity), PrintJSON (valid/invalid data), and RenderMarkdown/PrintResult output functions.
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
go test ./pkg/terminal/... -vTest Results
Checklist
go fmtandgo vetrun🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.