MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestAssertFormattedSQL_Matching

Function TestAssertFormattedSQL_Matching

pkg/gosqlx/testing/testing_test.go:138–152  ·  view source on GitHub ↗

Test AssertFormattedSQL with matching format

(t *testing.T)

Source from the content-addressed store, hash-verified

136
137// Test AssertFormattedSQL with matching format
138func TestAssertFormattedSQL_Matching(t *testing.T) {
139 mockT := &mockTestingT{}
140
141 // AST-based formatting with default options (IndentSize=2) produces multi-line output
142 sql := "SELECT * FROM users"
143 expected := "SELECT *\nFROM users"
144 result := AssertFormattedSQL(mockT, sql, expected)
145
146 if !result {
147 t.Error("AssertFormattedSQL should return true for matching format")
148 }
149 if mockT.failed {
150 t.Errorf("AssertFormattedSQL should not fail for matching format, got: %s", mockT.errorMsg)
151 }
152}
153
154// Test AssertFormattedSQL with non-matching format
155func TestAssertFormattedSQL_NotMatching(t *testing.T) {

Callers

nothing calls this directly

Calls 3

AssertFormattedSQLFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected