Skip to content

Commit

Permalink
Update main_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
NailaRais authored Nov 6, 2024
1 parent 54d7252 commit 74338ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/component/operator/text/v0/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"
"github.com/frankban/quicktest"
"strings" // Ensure this import is here
"github.com/instill-ai/pipeline-backend/pkg/component/base"
"github.com/instill-ai/pipeline-backend/pkg/component/internal/mock"
)
Expand Down Expand Up @@ -149,6 +150,11 @@ func TestCleanData(t *testing.T) {
}
}

// Helper function to normalize line endings across different environments
func normalizeLineEndings(input string) string {
return strings.ReplaceAll(input, "\r\n", "\n")
}

// Sample test in main_test.go with normalizeLineEndings
func TestValidateChunkPositionsInMain(t *testing.T) {
c := quicktest.New(t)
Expand All @@ -173,4 +179,3 @@ func TestValidateChunkPositionsInMain(t *testing.T) {
// Validate using validateChunkPositions or another test function
validateChunkPositions(c, chunks, expectedChunks)
}

0 comments on commit 74338ac

Please sign in to comment.