mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-24 05:59:55 +08:00
test(config) add path assertion
This commit is contained in:
@ -1,13 +1,14 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfig(t *testing.T) {
|
func TestConfig(t *testing.T) {
|
||||||
const filename = ".ipfsconfig"
|
const filename = ".ipfsconfig"
|
||||||
|
const dsPath = "/path/to/datastore"
|
||||||
cfgWritten := new(Config)
|
cfgWritten := new(Config)
|
||||||
|
cfgWritten.Datastore.Path = dsPath
|
||||||
err := WriteConfigFile(filename, cfgWritten)
|
err := WriteConfigFile(filename, cfgWritten)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
@ -17,6 +18,7 @@ func TestConfig(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if cfgWritten.Datastore.Path != cfgRead.Datastore.Path {
|
||||||
fmt.Printf(cfgRead.Datastore.Path)
|
t.Fail()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user