(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestReadGraphDataFile(t *testing.T) { |
| 253 | dir := t.TempDir() |
| 254 | path := filepath.Join(dir, "g.json") |
| 255 | if err := os.WriteFile(path, []byte(`{"nodes":[{"id":"a","label":"A"},{"id":"b","name":"B"}],"edges":[{"from":"a","to":"b"}]}`), 0o600); err != nil { |
| 256 | t.Fatalf("write: %v", err) |
| 257 | } |
| 258 | data, err := readGraphDataFile(path) |
| 259 | if err != nil { |
| 260 | t.Fatalf("read: %v", err) |
| 261 | } |
| 262 | if len(data.Nodes) != 2 || len(data.Edges) != 1 { |
| 263 | t.Fatalf("parsed = %+v", data) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | func TestExecuteGraphViewFromFileSource(t *testing.T) { |
| 268 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected