-
Notifications
You must be signed in to change notification settings - Fork 75
Modern POSIX style CLI for SQLCMD - Part 2 #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
we should commit .editorconfig so everyone gets the same behavior. the go tooling handles most of it ok but if there are options the go tools don't enforce automatically we should use this file for consistency. In reply to: 1279168195 In reply to: 1279168195 In reply to: 1279168195 In reply to: 1279168195 Refers to: .gitignore:27 in 3db8294. [](commit_id = 3db8294, deletion_comment = False) |
Done In reply to: 1279168195 Refers to: .gitignore:27 in 3db8294. [](commit_id = 3db8294, deletion_comment = False) |
a87366d
to
d372ba0
Compare
2f840eb
to
ca118d2
Compare
6d646db
to
10ee238
Compare
|
||
func TestMainStart(t *testing.T) { | ||
os.Args[1] = "--help" | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the structure looks ok to me. I don't see much value in unit tests that exercise a function with no assertions about the behavior. A unit test should serve as a specification (code > English) for a method, but without assertions there's no definition of correct behavior other than "it doesn't panic". With the dependency structure you have established, unit tests should have an easy ability to inject an interface implementation into the dependencies and verify that the method under test utilized that dependency correctly, much the way C# tests do with Moq. That way the unit test establishes the relationship between a given method and its dependencies and can truly prevent regressions in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the 2nd part for the modern-CLI. See PR165 for first part:
This PR moves the file-layout for the modern CLI to conform to the idiomatic golang layout, and focuses on test and code coverage, there is no new functionality in this PR. The Unit test coverage for the modern sqlcmd.exe now 95%+.
The formatting of the MIT license file was part of @shueybubbles original commit, I presume we want to keep these.
TODO: