-
Notifications
You must be signed in to change notification settings - Fork 4
new test for params.go #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cc5d89a
test
yegor256 64d38dd
Update internal/client/params_test.go
yegor256 f9acb0d
Initial plan
Copilot 0e20e9d
Initial plan
Copilot 2afe13d
Add edge case tests for mask function
Copilot 48601be
Add missing test coverage for NewMockParams fields
Copilot fc11dd6
Merge pull request #141 from cqfn/copilot/sub-pr-139-again
yegor256 4b9f911
Merge pull request #140 from cqfn/copilot/sub-pr-139
yegor256 0859fd2
Initial plan
Copilot 10ff813
Initial plan
Copilot 85aef9f
Remove redundant variable in TestNewMockParams_DisablesStats
Copilot 1b914c8
Remove TestMask tests from params_test.go
Copilot 1e628a1
Merge pull request #142 from cqfn/copilot/sub-pr-139-another-one
yegor256 9a682e0
Merge pull request #143 from cqfn/copilot/sub-pr-139-yet-again
yegor256 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| package client | ||
|
|
||
| import ( | ||
| "io" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestNewMockParams_CreatesValidInstance(t *testing.T) { | ||
| params := NewMockParams() | ||
| require.NotNil(t, params, "params must not be nil") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsMockProvider(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "mock", params.Provider, "provider must be mock") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDefaultToken(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "ABC", params.Token, "token must be ABC") | ||
| } | ||
|
|
||
| func TestNewMockParams_EnablesMockProject(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.True(t, params.MockProject, "mock project must be enabled") | ||
| } | ||
|
|
||
| func TestNewMockParams_DisablesDebug(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.False(t, params.Debug, "debug must be disabled") | ||
| } | ||
|
|
||
| func TestNewMockParams_DisablesStats(t *testing.T) { | ||
| assert.False(t, NewMockParams().Stats, "stats must be disabled") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsStdFormat(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "std", params.Format, "format must be std") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDefaultMaxSize(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, 200, params.MaxSize, "max size must be 200") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDiscardLog(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, io.Discard, params.Log, "log must be io.Discard") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDefaultChecks(t *testing.T) { | ||
| params := NewMockParams() | ||
| require.Equal(t, 1, len(params.Checks), "must have one check") | ||
| assert.Equal(t, "mvn clean test", params.Checks[0], "check must be mvn clean test") | ||
| } | ||
|
|
||
| func TestNewMockParams_DisablesColorless(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.False(t, params.Colorless, "colorless must be disabled") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDefaultModel(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "gpt-3.5-turbo", params.Model, "model must be gpt-3.5-turbo") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsDefaultAttempts(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, 3, params.Attempts, "attempts must be 3") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsEmptyPlaybook(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "", params.Playbook, "playbook must be empty") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsStatsOutput(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "stats", params.Soutput, "soutput must be stats") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsEmptyInput(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "", params.Input, "input must be empty") | ||
| } | ||
|
|
||
| func TestNewMockParams_SetsEmptyOutput(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.Equal(t, "", params.Output, "output must be empty") | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests for NewMockParams do not cover all fields set by the function. Missing test coverage for: Playbook (should be empty string), Soutput (should be "stats"), Input (should be empty string), and Output (should be empty string). Consider adding tests for these fields to ensure complete coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback