mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 13:27:03 +02:00
scrobblerlog: implemented append mode
This commit is contained in:
parent
1af484e0f6
commit
56eae67292
4 changed files with 60 additions and 12 deletions
|
@ -22,6 +22,7 @@ THE SOFTWARE.
|
|||
package scrobblerlog_test
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"strings"
|
||||
"testing"
|
||||
|
@ -114,3 +115,14 @@ func TestWrite(t *testing.T) {
|
|||
assert.Equal("", lines[4])
|
||||
assert.Equal(time.Unix(1699572072, 0), lastTimestamp)
|
||||
}
|
||||
|
||||
func TestReadHeader(t *testing.T) {
|
||||
data := bytes.NewBufferString(testScrobblerLog)
|
||||
reader := bufio.NewReader(data)
|
||||
log := scrobblerlog.ScrobblerLog{}
|
||||
err := scrobblerlog.ReadHeader(reader, &log)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, log.Timezone, "UNKNOWN")
|
||||
assert.Equal(t, log.Client, "Rockbox sansaclipplus $Revision$")
|
||||
assert.Empty(t, log.Listens)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue