package app import "rickub.com/turbo-editors/turbo-core/profile" // testProfile is the fictional editor the tests in this package drive. // // It is deliberately not Turbo Go: this package assembles *an* editor, and a // test that expected the Go menu, gopls or .turbo-go would be testing Turbo Go's // choices from inside the library those choices are made outside of. The // templates below are small but real, because the code under test writes them // out and reads them back. // // "Test" takes T as its hot key, which none of the fixed menus claims. func testProfile() profile.Profile { return profile.Profile{ Name: "Turbo Test", Slug: "turbo-test", Language: "Test", ToolsMenu: "~T~est", RootMarkers: []string{"test.mod"}, Server: profile.Server{ Command: "test-analyzer", InstallHint: "install test-analyzer", }, Templates: profile.Templates{ Settings: testSettingsTemplate, Snippets: testSnippetsTemplate, Tools: testToolsTemplate, Agents: testAgentsTemplate, }, } } // testSettingsTemplate takes the theme name and the autosave delay, in that // order, as profile.Templates says it must. const testSettingsTemplate = `# turbo-test project settings. # # Delete this file and the editor falls back to its own defaults. [editor] theme = %q autosave = false autosave_delay = %q ` // testSnippetsTemplate takes the ungrouped group's name and the user's own // snippets path, in that order. const testSnippetsTemplate = `# turbo-test snippets. # # A snippet with no group goes into %s. # Your own live in: # %s [[snippet]] name = "note" body = "NOTE: " ` const testToolsTemplate = `# turbo-test tools. [[tool]] name = "~B~uild" command = "true" output = "popup" ` // testAgentsTemplate takes the editor's own project directory and the user's // own agents path, in that order. const testAgentsTemplate = `# turbo-test agents. # # The agent's own configuration lives in %[1]s. # Your own agents live in: # %[2]s [[agent]] name = "Echo agent" command = "cat" `