microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
338 stars 60 forks source link

The TestCmd pattern does not provide functionality to validate output #215

Open stuartpa opened 1 year ago

stuartpa commented 1 year ago

Currently the Testcmd function just executes a command, but doesn't allow for further verification that the output generated was expected

cmdparser.TestSetup(t)
cmdparser.TestCmd[*AddEndpoint]()
cmdparser.TestCmd[*AddContext]("--endpoint endpoint")
cmdparser.TestCmd[*UseContext]("--name context")

Provide a pattern that enables TestCmd to validated the output was as expected, maybe an array/slice of RegExs that must validate?