Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
087a6f56
Commit
087a6f56
authored
Apr 19, 2024
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed FindConfigFileInArgsFallbackOnEnv unit test
parent
61b66a70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
internal/cli/configuration/configuration_test.go
internal/cli/configuration/configuration_test.go
+4
-2
No files found.
internal/cli/configuration/configuration_test.go
View file @
087a6f56
...
...
@@ -16,6 +16,7 @@
package
configuration
import
(
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
...
...
@@ -41,8 +42,9 @@ func TestInit(t *testing.T) {
}
func
TestFindConfigFile
(
t
*
testing
.
T
)
{
defaultConfigFile
:=
filepath
.
Join
(
getDefaultArduinoDataDir
(),
"arduino-cli.yaml"
)
configFile
:=
FindConfigFileInArgsFallbackOnEnv
([]
string
{
"--config-file"
})
require
.
Equal
(
t
,
""
,
configFile
)
require
.
Equal
(
t
,
defaultConfigFile
,
configFile
)
configFile
=
FindConfigFileInArgsFallbackOnEnv
([]
string
{
"--config-file"
,
"some/path/to/config"
})
require
.
Equal
(
t
,
"some/path/to/config"
,
configFile
)
...
...
@@ -51,7 +53,7 @@ func TestFindConfigFile(t *testing.T) {
require
.
Equal
(
t
,
"some/path/to/config/arduino-cli.yaml"
,
configFile
)
configFile
=
FindConfigFileInArgsFallbackOnEnv
([]
string
{})
require
.
Equal
(
t
,
""
,
configFile
)
require
.
Equal
(
t
,
defaultConfigFile
,
configFile
)
t
.
Setenv
(
"ARDUINO_CONFIG_FILE"
,
"some/path/to/config"
)
configFile
=
FindConfigFileInArgsFallbackOnEnv
([]
string
{})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment