(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func TestBuildInitializedNotification(t *testing.T) { |
| 157 | t.Parallel() |
| 158 | got := buildInitializedNotification() |
| 159 | |
| 160 | var msg map[string]json.RawMessage |
| 161 | if err := json.Unmarshal([]byte(got), &msg); err != nil { |
| 162 | t.Fatalf("result is not valid JSON: %v", err) |
| 163 | } |
| 164 | |
| 165 | // Must have jsonrpc and method |
| 166 | var method string |
| 167 | if err := json.Unmarshal(msg["method"], &method); err != nil { |
| 168 | t.Fatalf("failed to parse method: %v", err) |
| 169 | } |
| 170 | if method != "notifications/initialized" { |
| 171 | t.Errorf("expected method 'notifications/initialized', got %q", method) |
| 172 | } |
| 173 | |
| 174 | // Must NOT have an id (it's a notification) |
| 175 | if _, hasID := msg["id"]; hasID { |
| 176 | t.Error("notification should not have an 'id' field") |
| 177 | } |
| 178 | } |
nothing calls this directly
no test coverage detected