mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 08:27:08 +08:00
Fix error if history file doesn't exist
This commit is contained in:
26
session/snapshot_test.go
Normal file
26
session/snapshot_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/datarhei/core/v16/io/fs"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestHistorySource(t *testing.T) {
|
||||
memfs, err := fs.NewMemFilesystem(fs.MemConfig{})
|
||||
require.NoError(t, err)
|
||||
|
||||
s, err := NewHistorySource(memfs, "/foobar.json")
|
||||
require.NoError(t, err)
|
||||
require.Nil(t, s)
|
||||
}
|
||||
|
||||
func TestHistorySourceDisk(t *testing.T) {
|
||||
diskfs, err := fs.NewDiskFilesystem(fs.DiskConfig{})
|
||||
require.NoError(t, err)
|
||||
|
||||
s, err := NewHistorySource(diskfs, "./foobar.json")
|
||||
require.NoError(t, err)
|
||||
require.Nil(t, s)
|
||||
}
|
Reference in New Issue
Block a user