turbo-editors/turbo-corepublic Fork 0
d662cebdb65b319885da903daf7eff9ab1bfbb78
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

🛟 Updated. 28d5985 · on d662cebdb65b319885da903daf7eff9ab1bfbb78 · k33g · 21h ago
testprofile_test.go · 79 lines · 2.0 KBGo Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package app

import "codeberg.org/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"
`