kotokoko/chihaya — pull request #9 by cpb8010 (2013-04-28 05:36:15+00:00)
Title: Unit tests and Go benchmarks for methods in server.go

# Wrote simple tests and benchmarks for methods in server.go
All tests currently pass and were written to test error handling functionality
Run tests with *__go test__* and benchmarks with *__go test -bench .__* in server package directory
## Removed
* Removed server.parseQuery's attachment to the httpRequest struct for easier testing

## Added
* Created benchmarks that show server.parseQuery outperforms url.Parse and url.ParseRequestURI
* Note the test inputs are not representative of expected inputs; actual performance may differ.
* url.Parse and url.ParseRequestURI would need to be combined with url.Query for similar functionality to server.parseQuery
* Added tests to confirm error reporting for the private methods server.parseQuery and server.respond

## Changed
* Changed the functionality of server.parseQuery to support '?' as a delimiter
* Noted with tests that that server.parseQuery does not support multiple parameters with the same name

### Notes
These are very basic first tests and benchmarks that helped grow my understanding of the project; they are designed in such a way that should be easy for someone else to add additional cases where necessary without hindering re-factoring efforts.
Next, I plan to add tests and benchmarks to all methods in server
- [ ] announce.go
- [x] server.go
- [ ] scrape.go
- [ ] util.go