Fix bookmarks tests
This commit is contained in:
parent
d42bd2e803
commit
a207b66b7e
@ -7,17 +7,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test_Invalid_Bookmark_Files(t *testing.T) {
|
func Test_Invalid_Bookmark_Files(t *testing.T) {
|
||||||
examples := map[string]string{
|
_, err := readServerConfig("foobar")
|
||||||
"foobar": "open foobar: no such file or directory",
|
assert.Error(t, err)
|
||||||
"./fixtures/invalid.toml": "Near line 1, key 'invalid encoding': Near line 2: Expected key separator '=', but got '\\n' instead.",
|
|
||||||
"./fixtures/invalid_port.toml": "Type mismatch for 'main.Bookmark.Port': Expected string but found 'int64'.",
|
|
||||||
}
|
|
||||||
|
|
||||||
for path, message := range examples {
|
_, err = readServerConfig("./fixtures/invalid.toml")
|
||||||
_, err := readServerConfig(path)
|
assert.Error(t, err)
|
||||||
assert.Error(t, err)
|
assert.Equal(t, "Near line 1, key 'invalid encoding': Near line 2: Expected key separator '=', but got '\\n' instead.", err.Error())
|
||||||
assert.Equal(t, message, err.Error())
|
|
||||||
}
|
_, err = readServerConfig("./fixtures/invalid_port.toml")
|
||||||
|
assert.Error(t, err)
|
||||||
|
assert.Equal(t, "Type mismatch for 'main.Bookmark.Port': Expected string but found 'int64'.", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Bookmark(t *testing.T) {
|
func Test_Bookmark(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user