Closed calmh closed 8 years ago
Good in principle, but this is still Windows-specific code. Therefore the names should follow the naming pattern:
route_windows.go route_windows_test.go
Note that the underscore character has a special meaning in Go source file names, it's used for conditional compilation. (So _windows files are only compiled on Windows and _test files are only compiled on _test machines.)
The reason I suggest the name route is that this is a utility method for parsing the output of the Windows route command.
While that's of course correct, it means I would not be able to write or run this test as I develop on Mac. Hence the move out to the _common file.
@jackpal Any news on this?
I would like to see this merged in order to avoid shipping @calmh's fork of gateway in Debian.
Sorry, got busy with other stuff. Your argument about cross-platform development sounds reasonable.
Thank you!
This breaks out the parsing into a separate function for testing, and subjects it to some forms of invalid data. Also simplifies the "read all output" from route print step.