mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
23 lines
425 B
Go
23 lines
425 B
Go
|
package mmap_test
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"io/ioutil"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/influxdata/influxdb/pkg/mmap"
|
||
|
)
|
||
|
|
||
|
func TestMap(t *testing.T) {
|
||
|
data, err := mmap.Map("mmap_test.go")
|
||
|
if err != nil {
|
||
|
t.Fatalf("Open: %v", err)
|
||
|
}
|
||
|
|
||
|
if exp, err := ioutil.ReadFile("mmap_test.go"); err != nil {
|
||
|
t.Fatalf("ioutil.ReadFile: %v", err)
|
||
|
} else if !bytes.Equal(data, exp) {
|
||
|
t.Fatalf("got %q\nwant %q", string(data), string(exp))
|
||
|
}
|
||
|
}
|