1
0
Fork 0
mirror of https://github.com/laravel-ls/protocol.git synced 2026-06-16 03:54:56 +02:00
protocol/document_definition_test.go
2026-03-01 22:57:28 +01:00

18 lines
512 B
Go

package protocol_test
import (
"encoding/json"
"testing"
"github.com/laravel-ls/protocol"
)
func Test_DocumentDefinition_ParamsUnmarshalValidJSON(t *testing.T) {
var def protocol.DefinitionParams
if err := json.Unmarshal([]byte(`{"textDocument":{"uri":"file:///tmp/main.go"},"position":{"line":1,"character":1}}`), &def); err != nil {
t.Fatalf("unmarshal DefinitionParams failed: %v", err)
}
if def.TextDocument.URI != "file:///tmp/main.go" {
t.Fatalf("unexpected DefinitionParams: %+v", def)
}
}