Skip to content

yap: add comprehensive test cases (36.7% → 87.4% coverage)#175

Merged
xushiwei merged 1 commit intomainfrom
xgopilot/issue-174-1773362768
Mar 13, 2026
Merged

yap: add comprehensive test cases (36.7% → 87.4% coverage)#175
xushiwei merged 1 commit intomainfrom
xgopilot/issue-174-1773362768

Conversation

@xgopilot
Copy link

@xgopilot xgopilot bot commented Mar 13, 2026

Requested by @xushiwei

Closes #174

Summary

  • Added yap_ext_test.go with comprehensive test cases for the yap package
  • Coverage improved from 36.7% to 87.4%

What's covered

  • Context: Param, ParamInt, XGo_Env, Accept, Redirect, TEXT, DATA, JSON, PrettyJSON, STREAM
  • Engine: Handle, Static, StaticHttp, Handler (with middleware), SetDelims, FS, SubFS
  • Router HTTP methods: GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS
  • Router behaviors: trailing slash redirect, fixed path redirect, method-not-allowed (default & custom), panic handler, not found fallback, POST permanent redirect
  • App classfile methods: Get, Head, Options, Post, Put, Patch, Delete, Static__0, Static__2
  • Context shorthand helpers: Text__0Text__4, Binary__0Binary__4, Html__0Html__3, Json__0Json__1, PrettyJson__0PrettyJson__1, Stream__0Stream__3

…7.4%

Tests cover Context methods (Param, ParamInt, Accept, Redirect, TEXT, DATA,
JSON, PrettyJSON, STREAM), Engine methods (Handle, Static, StaticHttp, Handler,
SetDelims, FS, SubFS), router HTTP methods (GET, HEAD, POST, PUT, PATCH, DELETE,
OPTIONS), router behavior (trailing slash redirect, fixed path redirect,
method-not-allowed, panic handler), App classfile methods, and all Context
response shorthand helpers (Text__*, Binary__*, Html__*, Json__*, PrettyJson__*,
Stream__*).

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xushiwei <396972+xushiwei@users.noreply.github.com>
@xgopilot xgopilot bot mentioned this pull request Mar 13, 2026
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.06%. Comparing base (ad4b9fa) to head (48b0c5e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #175       +/-   ##
===========================================
+ Coverage   53.74%   81.06%   +27.31%     
===========================================
  Files           8        8               
  Lines         787      787               
===========================================
+ Hits          423      638      +215     
+ Misses        338      124      -214     
+ Partials       26       25        -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xushiwei xushiwei merged commit 3958231 into main Mar 13, 2026
11 checks passed
@xgopilot xgopilot bot deleted the xgopilot/issue-174-1773362768 branch March 13, 2026 00:54
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.

Add test cases for yap

2 participants