mirror of
https://github.com/laravel-ls/protocol.git
synced 2026-06-17 20:40:04 +02:00
add tests
This commit is contained in:
parent
5049160990
commit
be37cd5a53
20 changed files with 755 additions and 1 deletions
18
server_test.go
Normal file
18
server_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package protocol_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/laravel-ls/protocol"
|
||||
)
|
||||
|
||||
func Test_Server_InfoUnmarshalValidJSON(t *testing.T) {
|
||||
var serverInfo protocol.ServerInfo
|
||||
if err := json.Unmarshal([]byte(`{"name":"my-ls","version":"0.0.1"}`), &serverInfo); err != nil {
|
||||
t.Fatalf("unmarshal ServerInfo failed: %v", err)
|
||||
}
|
||||
if serverInfo.Name != "my-ls" {
|
||||
t.Fatalf("unexpected ServerInfo: %+v", serverInfo)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue