MCPcopy Create free account
hub / github.com/go-task/task / TestNormalizePathSeparators

Function TestNormalizePathSeparators

task_test.go:359–377  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

357}
358
359func TestNormalizePathSeparators(t *testing.T) {
360 t.Parallel()
361 tests := []struct {
362 name string
363 input string
364 expected string
365 }{
366 {"Windows path", `D:\a\task\task`, `D:/a/task/task`},
367 {"Unix path unchanged", `/home/user/task`, `/home/user/task`},
368 {"Mixed separators", `C:\Users/name\file`, `C:/Users/name/file`},
369 }
370 for _, tt := range tests {
371 t.Run(tt.name, func(t *testing.T) {
372 t.Parallel()
373 got := normalizePathSeparators(tt.input)
374 assert.Equal(t, tt.expected, got)
375 })
376 }
377}
378
379// SyncBuffer is a threadsafe buffer for testing.
380// Some times replace stdout/stderr with a buffer to capture output.

Callers

nothing calls this directly

Calls 2

normalizePathSeparatorsFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…