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

Function TestWorkspaceAgentLogTextMultiline

codersdk/workspaceagents_test.go:86–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestWorkspaceAgentLogTextMultiline(t *testing.T) {
87 t.Parallel()
88
89 ts := time.Date(2024, 1, 28, 10, 30, 0, 0, time.UTC)
90 log := codersdk.WorkspaceAgentLog{
91 CreatedAt: ts,
92 Level: codersdk.LogLevelInfo,
93 Output: "Line 1\nLine 2\nLine 3",
94 SourceID: uuid.New(),
95 }
96 result := log.Text("main", "startup_script")
97 require.Equal(t, "2024-01-28T10:30:00Z [info] [agent.main|startup_script] Line 1\nLine 2\nLine 3", result)
98}
99
100func TestWorkspaceAgentLogTextSpecialChars(t *testing.T) {
101 t.Parallel()

Callers

nothing calls this directly

Calls 3

TextMethod · 0.95
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected