MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestStripLineNumbers

Function TestStripLineNumbers

internal/tui/log_test.go:175–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

173}
174
175func TestStripLineNumbers(t *testing.T) {
176 tests := []struct {
177 name string
178 input string
179 expected string
180 }{
181 {
182 name: "arrow format",
183 input: " 1→<?php\n 2→\n 3→use App\\Models;",
184 expected: "<?php\n\nuse App\\Models;",
185 },
186 {
187 name: "tab format",
188 input: " 1\t<?php\n 2\t\n 3\tuse App\\Models;",
189 expected: "<?php\n\nuse App\\Models;",
190 },
191 {
192 name: "double digit line numbers",
193 input: " 10→function test() {\n 11→ return true;\n 12→}",
194 expected: "function test() {\n return true;\n}",
195 },
196 {
197 name: "no line numbers",
198 input: "<?php\nuse App\\Models;",
199 expected: "<?php\nuse App\\Models;",
200 },
201 {
202 name: "empty string",
203 input: "",
204 expected: "",
205 },
206 }
207
208 for _, tt := range tests {
209 t.Run(tt.name, func(t *testing.T) {
210 result := stripLineNumbers(tt.input)
211 if result != tt.expected {
212 t.Errorf("stripLineNumbers() =\n%q\nwant:\n%q", result, tt.expected)
213 }
214 })
215 }
216}

Callers

nothing calls this directly

Calls 2

stripLineNumbersFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected