@@ -178,139 +178,6 @@ func TestSanitizePath(t *testing.T) {
178178 }
179179}
180180
181- // TestCaptureFormulae tests that CaptureFormulae returns a slice.
182- func TestCaptureFormulae (t * testing.T ) {
183- formulae , err := CaptureFormulae ()
184- // Should either succeed or fail gracefully
185- assert .True (t , err == nil || formulae != nil )
186- assert .IsType (t , []string {}, formulae )
187- }
188-
189- // TestCaptureCasks tests that CaptureCasks returns a slice.
190- func TestCaptureCasks (t * testing.T ) {
191- casks , err := CaptureCasks ()
192- // Should either succeed or fail gracefully
193- assert .True (t , err == nil || casks != nil )
194- assert .IsType (t , []string {}, casks )
195- }
196-
197- // TestCaptureTaps tests that CaptureTaps returns a slice.
198- func TestCaptureTaps (t * testing.T ) {
199- taps , err := CaptureTaps ()
200- // Should either succeed or fail gracefully
201- assert .True (t , err == nil || taps != nil )
202- assert .IsType (t , []string {}, taps )
203- }
204-
205- // TestCaptureNpm tests that CaptureNpm returns a slice.
206- func TestCaptureNpm (t * testing.T ) {
207- npm , err := CaptureNpm ()
208- // Should either succeed or fail gracefully
209- assert .True (t , err == nil || npm != nil )
210- assert .IsType (t , []string {}, npm )
211- }
212-
213- // TestCaptureShell tests that CaptureShell returns a ShellSnapshot.
214- func TestCaptureShell (t * testing.T ) {
215- shell , err := CaptureShell ()
216- assert .NoError (t , err )
217- assert .NotNil (t , shell )
218- assert .IsType (t , & ShellSnapshot {}, shell )
219- }
220-
221- // TestCaptureGit tests that CaptureGit returns a GitSnapshot.
222- func TestCaptureGit (t * testing.T ) {
223- git , err := CaptureGit ()
224- assert .NoError (t , err )
225- assert .NotNil (t , git )
226- assert .IsType (t , & GitSnapshot {}, git )
227- }
228-
229- // TestCaptureDevTools tests that CaptureDevTools returns a slice.
230- func TestCaptureDevTools (t * testing.T ) {
231- tools , err := CaptureDevTools ()
232- assert .NoError (t , err )
233- assert .NotNil (t , tools )
234- assert .IsType (t , []DevTool {}, tools )
235- }
236-
237- // TestCaptureMacOSPrefs tests that CaptureMacOSPrefs returns a slice.
238- func TestCaptureMacOSPrefs (t * testing.T ) {
239- prefs , err := CaptureMacOSPrefs ()
240- // Should either succeed or fail gracefully
241- assert .True (t , err == nil || prefs != nil )
242- assert .IsType (t , []MacOSPref {}, prefs )
243- }
244-
245- // TestParseLines_EdgeCases tests parseLines with edge cases.
246- func TestParseLines_EdgeCases (t * testing.T ) {
247- tests := []struct {
248- name string
249- input string
250- minItems int
251- maxItems int
252- }{
253- {
254- name : "only whitespace" ,
255- input : " \n \n " ,
256- minItems : 0 ,
257- maxItems : 0 ,
258- },
259- {
260- name : "mixed whitespace" ,
261- input : " \t \n \t \n \t " ,
262- minItems : 0 ,
263- maxItems : 0 ,
264- },
265- {
266- name : "single item with spaces" ,
267- input : " git " ,
268- minItems : 1 ,
269- maxItems : 1 ,
270- },
271- }
272-
273- for _ , tt := range tests {
274- t .Run (tt .name , func (t * testing.T ) {
275- result := parseLines (tt .input )
276- assert .GreaterOrEqual (t , len (result ), tt .minItems )
277- assert .LessOrEqual (t , len (result ), tt .maxItems )
278- })
279- }
280- }
281-
282- // TestParseVersion_EdgeCases tests parseVersion with edge cases.
283- func TestParseVersion_EdgeCases (t * testing.T ) {
284- tests := []struct {
285- name string
286- toolName string
287- output string
288- }{
289- {
290- name : "empty output" ,
291- toolName : "go" ,
292- output : "" ,
293- },
294- {
295- name : "whitespace only" ,
296- toolName : "node" ,
297- output : " " ,
298- },
299- {
300- name : "malformed output" ,
301- toolName : "go" ,
302- output : "invalid output format" ,
303- },
304- }
305-
306- for _ , tt := range tests {
307- t .Run (tt .name , func (t * testing.T ) {
308- result := parseVersion (tt .toolName , tt .output )
309- // Should not panic and return a string
310- assert .IsType (t , "" , result )
311- })
312- }
313- }
314181
315182func TestCaptureWithProgress_HealthTracksFailedSteps (t * testing.T ) {
316183 steps := []captureStep {
0 commit comments