mirror of
https://github.com/laravel-ls/protocol.git
synced 2026-06-16 03:54:56 +02:00
add tests
This commit is contained in:
parent
5049160990
commit
be37cd5a53
20 changed files with 755 additions and 1 deletions
18
document_hover_test.go
Normal file
18
document_hover_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package protocol_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/laravel-ls/protocol"
|
||||
)
|
||||
|
||||
func Test_DocumentHover_ParamsUnmarshalValidJSON(t *testing.T) {
|
||||
var hover protocol.HoverParams
|
||||
if err := json.Unmarshal([]byte(`{"textDocument":{"uri":"file:///tmp/main.go"},"position":{"line":1,"character":1}}`), &hover); err != nil {
|
||||
t.Fatalf("unmarshal HoverParams failed: %v", err)
|
||||
}
|
||||
if hover.TextDocument.URI == "" {
|
||||
t.Fatalf("unexpected HoverParams: %+v", hover)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue