yap: add comprehensive test cases (36.7% → 87.4% coverage)#175
Merged
Conversation
…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>
Closed
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by @xushiwei
Closes #174
Summary
yap_ext_test.gowith comprehensive test cases for theyappackageWhat's covered
Context:Param,ParamInt,XGo_Env,Accept,Redirect,TEXT,DATA,JSON,PrettyJSON,STREAMEngine:Handle,Static,StaticHttp,Handler(with middleware),SetDelims,FS,SubFSGET,HEAD,POST,PUT,PATCH,DELETE,OPTIONSAppclassfile methods:Get,Head,Options,Post,Put,Patch,Delete,Static__0,Static__2Text__0–Text__4,Binary__0–Binary__4,Html__0–Html__3,Json__0–Json__1,PrettyJson__0–PrettyJson__1,Stream__0–Stream__3