mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
Add an MCP Streamable HTTP server with token authentication, screenshot capture, keyboard, and mouse tools. Introduce shared control-mode and input-control coordination so MCP, PicoClaw, and local HID paths serialize ownership safely. Integrate PicoClaw gateway/runtime control handoff with PID-managed startup and focused unit coverage.
17 lines
449 B
Go
17 lines
449 B
Go
package hid
|
|
|
|
import "testing"
|
|
|
|
func TestReportLengthValidation(t *testing.T) {
|
|
h := &Hid{}
|
|
if err := h.WriteKeyboardReport(make([]byte, 7)); err == nil {
|
|
t.Fatal("expected keyboard length error")
|
|
}
|
|
if err := h.WriteRelativeMouseReport(make([]byte, 5)); err == nil {
|
|
t.Fatal("expected relative mouse length error")
|
|
}
|
|
if err := h.WriteAbsoluteMouseReport(make([]byte, 7)); err == nil {
|
|
t.Fatal("expected absolute mouse length error")
|
|
}
|
|
}
|