shithub: mycel

ref: ee24c464cba91f2d9a09c3645d34a8275d4e908b
dir: /browser/fs/fs_test.go/

View raw version
package fs

import (
	"bufio"
	"io"
	"net"
	"testing"
)

func TestQuery(t *testing.T) {
	fs := New()
	c1, c2 := net.Pipe()
	go fs.query(c2)
	w := bufio.NewWriter(c1)
	w.WriteString("echo\n")
	w.Flush()
	bs, err := io.ReadAll(c1)
	if string(bs) != "" || err != nil {
		t.Fail()
	}
}