| 98 | } |
| 99 | |
| 100 | func TestWorkspaceAgentLogTextSpecialChars(t *testing.T) { |
| 101 | t.Parallel() |
| 102 | |
| 103 | ts := time.Date(2024, 1, 28, 10, 30, 0, 0, time.UTC) |
| 104 | log := codersdk.WorkspaceAgentLog{ |
| 105 | CreatedAt: ts, |
| 106 | Level: codersdk.LogLevelDebug, |
| 107 | Output: "\033[31mError!\033[0m 🚀 Unicode: 日本語", |
| 108 | SourceID: uuid.New(), |
| 109 | } |
| 110 | result := log.Text("main", "startup_script") |
| 111 | require.Equal(t, "2024-01-28T10:30:00Z [debug] [agent.main|startup_script] \033[31mError!\033[0m 🚀 Unicode: 日本語", result) |
| 112 | } |
| 113 | |
| 114 | func TestWorkspaceAgentDevcontainerEquals(t *testing.T) { |
| 115 | t.Parallel() |