shithub: mycel

Download patch

ref: 3ef504d6d69ffd86e01f77dce03b07e625d1203c
parent: 5598e0c61213eb2a893bad4625005b72d2b5ecf0
author: Philip Silva <philip.silva@protonmail.com>
date: Thu Apr 17 11:00:00 EDT 2025

add fs test

--- /dev/null
+++ b/browser/fs/fs_test.go
@@ -1,0 +1,21 @@
+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()
+	}
+}