MCPcopy Index your code
hub / github.com/coder/coder / TestApplicationURLString

Function TestApplicationURLString

coderd/workspaceapps/appurl/appurl_test.go:12–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestApplicationURLString(t *testing.T) {
13 t.Parallel()
14
15 testCases := []struct {
16 Name string
17 URL appurl.ApplicationURL
18 Expected string
19 }{
20 {
21 Name: "Empty",
22 URL: appurl.ApplicationURL{},
23 Expected: "----",
24 },
25 {
26 Name: "AppName",
27 URL: appurl.ApplicationURL{
28 AppSlugOrPort: "app",
29 AgentName: "agent",
30 WorkspaceName: "workspace",
31 Username: "user",
32 },
33 Expected: "app--agent--workspace--user",
34 },
35 {
36 Name: "Port",
37 URL: appurl.ApplicationURL{
38 AppSlugOrPort: "8080",
39 AgentName: "agent",
40 WorkspaceName: "workspace",
41 Username: "user",
42 },
43 Expected: "8080--agent--workspace--user",
44 },
45 {
46 Name: "Prefix",
47 URL: appurl.ApplicationURL{
48 Prefix: "yolo---",
49 AppSlugOrPort: "app",
50 AgentName: "agent",
51 WorkspaceName: "workspace",
52 Username: "user",
53 },
54 Expected: "yolo---app--agent--workspace--user",
55 },
56 {
57 Name: "5DigitAppSlug",
58 URL: appurl.ApplicationURL{
59 AppSlugOrPort: "30000",
60 AgentName: "",
61 WorkspaceName: "workspace",
62 Username: "user",
63 },
64 Expected: "30000--workspace--user",
65 },
66 {
67 Name: "4DigitPort",
68 URL: appurl.ApplicationURL{
69 AppSlugOrPort: "1234",

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
EqualMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected