TODO(rfindley): add client conformance tests.
(t *testing.T)
| 59 | // TODO(rfindley): add client conformance tests. |
| 60 | |
| 61 | func TestServerConformance(t *testing.T) { |
| 62 | var tests []*conformanceTest |
| 63 | dir := filepath.Join("testdata", "conformance", "server") |
| 64 | if err := filepath.WalkDir(dir, func(path string, _ fs.DirEntry, err error) error { |
| 65 | if err != nil { |
| 66 | return err |
| 67 | } |
| 68 | if strings.HasSuffix(path, ".txtar") { |
| 69 | test, err := loadConformanceTest(dir, path) |
| 70 | if err != nil { |
| 71 | return fmt.Errorf("%s: %v", path, err) |
| 72 | } |
| 73 | tests = append(tests, test) |
| 74 | } |
| 75 | return nil |
| 76 | }); err != nil { |
| 77 | t.Fatal(err) |
| 78 | } |
| 79 | |
| 80 | for _, test := range tests { |
| 81 | t.Run(test.name, func(t *testing.T) { |
| 82 | // We use synctest here because in general, there is no way to know when the |
| 83 | // server is done processing any notifications. As long as our server doesn't |
| 84 | // do background work, synctest provides an easy way for us to detect when the |
| 85 | // server is done processing. |
| 86 | // |
| 87 | // By comparison, gopls has a complicated framework based on progress |
| 88 | // reporting and careful accounting to detect when all 'expected' work |
| 89 | // on the server is complete. |
| 90 | synctest.Test(t, func(t *testing.T) { |
| 91 | runServerTest(t, test) |
| 92 | }) |
| 93 | }) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | type structuredInput struct { |
| 98 | In string `jsonschema:"the input"` |
nothing calls this directly
no test coverage detected
searching dependent graphs…