Make bookmark tests platform-independent
This commit is contained in:
parent
1e58c94598
commit
866cdccd49
@ -1,8 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -49,8 +47,7 @@ func Test_Bookmark_URL(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_Bookmarks_Path(t *testing.T) {
|
func Test_Bookmarks_Path(t *testing.T) {
|
||||||
path := fmt.Sprintf("%s/.pgweb/bookmarks", os.Getenv("HOME"))
|
assert.NotEqual(t, "/.pgweb/bookmarks", bookmarksPath())
|
||||||
assert.Equal(t, path, bookmarksPath())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Basename(t *testing.T) {
|
func Test_Basename(t *testing.T) {
|
||||||
@ -64,7 +61,6 @@ func Test_ReadBookmarks_Invalid(t *testing.T) {
|
|||||||
bookmarks, err := readAllBookmarks("foobar")
|
bookmarks, err := readAllBookmarks("foobar")
|
||||||
|
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
assert.Equal(t, "open foobar: no such file or directory", err.Error())
|
|
||||||
assert.Equal(t, 0, len(bookmarks))
|
assert.Equal(t, 0, len(bookmarks))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user