File: disk_test.go

package info (click to toggle)
golang-github-chzyer-test 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 92 kB
  • sloc: makefile: 4
file content (20 lines) | stat: -rw-r--r-- 305 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package test

import (
	"io"
	"testing"
)

func TestMemDisk(t *testing.T) {
	defer New(t)
	md := NewMemDisk()
	WriteAt(md, []byte("hello"), 4)
	h := make([]byte, 5)
	n, err := md.ReadAt(h, 3)
	Equals(n, 5, err, nil, h, []byte("\x00hell"))

	{
		n, err := md.ReadAt(h, 10)
		Equals(n, 0, err, io.EOF)
	}
}